Files
kotlin-fork/compiler/testData/codegen/box/exclExcl/kt48440.kt
T
2021-09-08 19:56:38 +03:00

20 lines
326 B
Kotlin
Vendored

fun test(): String {
var exception: Throwable? = null
val f = {
exception = IllegalStateException("OK")
}
f()
if (exception != null) {
throw exception!!
} else {
return "Fail"
}
}
fun box(): String = try {
test()
} catch (e: IllegalStateException) {
e.message!!
}