Files
kotlin/compiler/testData/codegen/bytecodeText/constCoroutine.kt
Denis Zharkov d657bc8110 Treat any coroutine as it has non-const closure
Because it's always does capture controller
2016-07-05 15:36:06 +03:00

24 lines
430 B
Kotlin
Vendored

class Controller {
suspend fun suspendHere(x: Continuation<String>) {
}
}
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