Files
kotlin/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt
2018-06-09 19:15:38 +03:00

20 lines
329 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
// 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()