Treat any coroutine as it has non-const closure

Because it's always does capture controller
This commit is contained in:
Denis Zharkov
2016-07-04 15:32:54 +03:00
parent df4bf61378
commit d657bc8110
8 changed files with 83 additions and 2 deletions
@@ -0,0 +1,23 @@
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