JVM_IR: do not box inline classes in suspend synthetic accessors

This commit is contained in:
pyos
2021-04-22 10:19:45 +02:00
committed by Ilmir Usmanov
parent 857bee6ced
commit 7d95943b8b
11 changed files with 90 additions and 24 deletions
@@ -0,0 +1,29 @@
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
@Suppress("UNSUPPORTED_FEATURE")
inline class I(val x: Any?)
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { c ->
c.resume(Unit)
COROUTINE_SUSPENDED
}
class C {
private suspend fun f(): I {
suspendHere()
return I("OK")
}
fun g() = suspend { f() }
}
fun box(): String {
var result = "fail"
suspend { result = C().g()().x as String }.startCoroutine(EmptyContinuation)
return result
}