Thy is boxing happening here? Shouldn't the user o...
# announcements
m
Thy is boxing happening here? Shouldn't the user of
SomeInlineClass.print()
be known at compile-time?
Copy code
interface Inline {
    fun print()
}

inline class SomeInlineClass(private val value: Int) : Inline {
    override fun print() {
        print(value)
    }
}

inline fun <T : Inline> printInline(inline: T) {
    inline.print()
}

fun main() {
    printInline(SomeInlineClass(2)) // why boxing?
}