Files
kotlin/compiler/testData/codegen/bytecodeText/constCoroutine.kt
2017-01-27 23:24:13 +03:00

27 lines
612 B
Kotlin
Vendored

// WITH_RUNTIME
// WITH_COROUTINES
// TREAT_AS_ONE_FILE
import kotlin.coroutines.experimental.*
import kotlin.coroutines.experimental.intrinsics.*
suspend fun suspendHere() = ""
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
fun box(): String {
for (i in 1..3) {
builder {
if (suspendHere() != "OK") throw java.lang.RuntimeException("fail 1")
}
}
return "OK"
}
// 2 GETSTATIC kotlin/Unit.INSTANCE
// 1 GETSTATIC EmptyContinuation.Companion
// 3 GETSTATIC kotlin\/coroutines\/experimental\/EmptyCoroutineContext.INSTANCE
// 6 GETSTATIC