Some methods in Kotlin stdlib are marked with inline annotation @kotlin.internal.InlineOnly . This forces the compiler to embed them in kotlin code without generating the appropriate methods in the JVM classes.
This trick is used to reduce the number of methods on stdlib. This is a dangerous solution and may cause problems with separate compilation if used improperly.
Catch: annotation @kotlin.internal.InlineOnly is internal and can only be used in the standard library. I do not know what plans to release in the public API.
TL DR: you can do it, but only if you contribute to Kotlin stdlib
source share