JVM_IR: expect unboxed return value from suspend default stubs
#KT-47206 Fixed
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// WITH_RUNTIME
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {
|
||||
it.getOrThrow()
|
||||
})
|
||||
}
|
||||
|
||||
inline class IC(val s: String)
|
||||
|
||||
suspend fun foo(x: String = "OK") = IC(x)
|
||||
|
||||
fun box(): String {
|
||||
var res = ""
|
||||
builder {
|
||||
res = foo().s
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// WITH_RUNTIME
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
inline class IC(val s: String)
|
||||
|
||||
suspend fun foo(x: String = "OK") = suspendCoroutineUninterceptedOrReturn<IC> {
|
||||
it.resume(IC(x))
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var res = ""
|
||||
suspend { res = foo().s }.startCoroutine(Continuation(EmptyCoroutineContext) { it.getOrThrow() })
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user