mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-13 08:31:31 +00:00
Desugar constructor call of inline class to the underlying value
Also add information about KotlinType to the constant stack values
This commit is contained in:
20
compiler/testData/codegen/bytecodeText/inlineClasses/boxResultAfterConstructorCall.kt
vendored
Normal file
20
compiler/testData/codegen/bytecodeText/inlineClasses/boxResultAfterConstructorCall.kt
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
// !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
|
||||
Reference in New Issue
Block a user