Files
kotlin-fork/compiler/testData/codegen/box/callableReference/adaptedReferences/suspendConversion/bound.kt
T
Anton Bannykh 86b5c63891 JS IR: fix origin for callable references with bound reciever
In case of IrFunctionReference with type SuspendFunction (no K!) there
was a misalignment between the base class (Any) and the
origin (LAMBDA..). As a result the SuspendFunctionLowering was
getting confused and produced hanging code.
2020-05-14 14:33:12 +03:00

28 lines
450 B
Kotlin
Vendored

// !LANGUAGE: +SuspendConversion
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JVM_IR
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun runSuspend(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
class C {
var test = "failed"
fun foo() {
test = "OK"
}
}
fun box(): String {
val c = C()
runSuspend(c::foo)
return c.test
}