Files
kotlin-fork/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt
T
2019-11-19 11:00:09 +03:00

21 lines
359 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
fun box(): String {
val a = arrayListOf<String>()
while (true) {
if (a.size == 0) {
break
}
}
for (i in 1..2) {
a.add(try { foo() } catch (e: Throwable) { "OK" })
}
return a[0]
}
fun foo(): String = throw RuntimeException()