Treat any coroutine as it has non-const closure
Because it's always does capture controller
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user