Inline classes are a new language feature in Kotlin and they are currently in alpha. Inline classes are simple wrapper classes that are optimized by the Kotlin runtime to avoid the performance hit of initializing a class. Let’s look at a few examples. This is a standard Kotlin class and is perfectly usable. However, classes are more expensive to initialize than fields. These classes have an especially high cost if you are wrapping a primitive, because primitives in Kotlin are heavily optimized by the runtime. This class wouldn’t get any of those optimizations. Alternatively we could just have the phone number be a property that lives in another class a la: Of course we now lose type safety and could[…]