The Kotlin documentation itself states the following:
If an inline function has no inlinable function parameters and no reified type parameters, the compiler will issue a warning, since inlining such functions is very unlikely to be beneficial.
Both statements, no inlinable function parameters and no reified type parameters, are true for, for example, the following extension methods in String.kt
:
public inline fun String.reversed(): String
public inline fun String.slice(indices: Iterable<Int>) : String
public inline fun CharSequence.random(): Char
Can anyone explain me a specific reason why the language designers probably made the decisions to mark these methods as inline? Thanks.