mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 00:21:26 +00:00
24 lines
454 B
Kotlin
Vendored
24 lines
454 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 kotlin/coroutines/Suspend.INSTANCE
|
|
// 2 GETSTATIC
|