Fix boxing for non-local and labeled returns with inline classes

This commit is contained in:
Mikhail Zarechenskiy
2018-02-09 07:13:55 +03:00
parent 80dd5c106e
commit 1d16d21dbb
9 changed files with 110 additions and 7 deletions
@@ -0,0 +1,29 @@
// !LANGUAGE: +InlineClasses
inline class ULong(val l: Long)
fun nonLocal(): ULong? {
val u = ULong(0)
run {
return u // box
}
TODO()
}
fun foo(): Boolean = true
fun labeled(): ULong? {
val u = ULong(0)
return run {
if (foo()) return@run u
u // box
}
}
// 2 INVOKESTATIC ULong\$Erased.box
// 0 INVOKEVIRTUAL ULong.unbox
// 0 valueOf
// 0 intValue