Files
kotlin/compiler/testData/codegen/bytecodeText/inlineClasses/boxResultAfterConstructorCall.kt
Mikhail Zarechenskiy 8015295059 Desugar constructor call of inline class to the underlying value
Also add information about KotlinType to the constant stack values
2018-02-13 13:16:39 +03:00

20 lines
387 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
inline class AsInt(val value: Int)
inline class AsAny(val value: Any)
fun takeAny(a: Any) {}
fun test() {
takeAny(AsInt(123)) // box
takeAny(AsAny(123)) // box int, box inline class
}
// 1 INVOKESTATIC AsInt\$Erased.box
// 0 INVOKEVIRTUAL AsInt.unbox
// 1 INVOKESTATIC AsAny\$Erased.box
// 0 INVOKEVIRTUAL AsAny.unbox
// 1 valueOf
// 0 intValue