From version 1.3+, Kotlin introduces a special kind of class called an inline class, which is declared by placing an 'inline' modifier before the name of the class. They provide a way to wrap a type, thus adding functionality and creating a new type by itself. As opposed to regular wrappers, they will benefit from improved performance. This happens because the data is inlined into its usages, and object instantiation is skipped in the compiled code.
Inline
classes provide us with a way to wrap a type, thus adding functionality and creating a new type by itself.
As opposed to regular (non-inlined) wrappers, they will benefit from improved performance. This happens because the data is inlined into its usages, and object instantiation is skipped in the resulting compiled code.