Box inline class return value in lambdas (including suspend lambdas)

This commit is contained in:
Dmitry Petrov
2020-04-08 12:28:17 +03:00
parent 59b72b3156
commit 9615b20e5d
22 changed files with 691 additions and 18 deletions
@@ -1,4 +1,5 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND: JVM_IR
// FILE: utils.kt
@@ -21,13 +22,13 @@ fun foo(): Boolean = true
fun labeled(): ULong? {
val u = ULong(0)
return run {
if (foo()) return@run u
if (foo()) return@run u // box
u // box
}
}
// @TestKt.class:
// 2 INVOKESTATIC ULong\.box
// 3 INVOKESTATIC ULong\.box
// 0 INVOKEVIRTUAL ULong.unbox
// 0 valueOf