Hack attributes for continuation of suspend function in SAM-adapter
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
fun interface Action {
|
||||
suspend fun run()
|
||||
}
|
||||
suspend fun runAction(a: Action) {
|
||||
a.run()
|
||||
}
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
fun box(): String {
|
||||
var res = "FAIL"
|
||||
builder {
|
||||
runAction {
|
||||
res = "OK"
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user