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

21 lines
360 B
Kotlin
Vendored

fun <T> id(t: T): T = t
fun test(b: Boolean): String {
var exception: Throwable? = null
if (b) {
exception = IllegalStateException("OK")
}
if (exception != null) {
throw id(exception)!!
} else {
return "Fail"
}
}
fun box(): String = try {
test(true)
} catch (e: IllegalStateException) {
e.message!!
}