Files
kotlin-fork/compiler/testData/codegen/box/controlStructures/kt8148_continue.kt
T
2020-11-09 16:04:43 +03:00

37 lines
707 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: EXCEPTIONS_NOT_IMPLEMENTED
class A(var value: String)
fun box(): String {
val a = A("start")
try {
test(a)
} catch(e: RuntimeException) {
}
if (a.value != "start, try, finally1, finally2") return "fail: ${a.value}"
return "OK"
}
fun test(a: A) : String {
while (a.value == "start") {
try {
try {
a.value += ", try"
continue
}
finally {
a.value += ", finally1"
}
}
finally {
a.value += ", finally2"
throw RuntimeException("fail")
}
}
return "fail"
}