Files
kotlin-fork/backend.native/tests/external/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt
T
2017-11-16 17:21:48 +03:00

19 lines
304 B
Kotlin

// 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()