Files
kotlin/compiler/testData/codegen/bytecodeText/constCoroutine.kt
Denis Zharkov 1f98accad2 Support new suspend convention in JVM backend partially
Stack-unwinding does not work yet

 #KT-14924 In Progress
2016-11-29 14:14:50 +03:00

23 lines
404 B
Kotlin
Vendored

class Controller {
suspend fun suspendHere() = ""
}
fun builder(coroutine c: Controller.() -> Continuation<Unit>) {
c(Controller()).resume(Unit)
}
fun box(): String {
for (i in 1..3) {
builder {
if (suspendHere() != "OK") throw java.lang.RuntimeException("fail 1")
}
}
return "OK"
}
// 1 GETSTATIC kotlin/Unit.INSTANCE : Lkotlin/Unit;
// 1 GETSTATIC