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:
Mikhail Zarechenskiy
2018-02-09 04:10:58 +03:00
parent 6320368609
commit 8015295059
10 changed files with 123 additions and 10 deletions

View 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