Files
kotlin-fork/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/deadTryCatch.kt
T
2018-06-28 12:26:41 +02:00

27 lines
459 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
inline fun catchAll(x: String, block: () -> Unit): String {
try {
block()
} catch (e: Throwable) {
}
return x
}
inline fun tryTwice(block: () -> Unit) {
try {
block()
try {
block()
} catch (e: Exception) {
}
} catch (e: Exception) {
}
}
fun box(): String {
return catchAll("OK") {
tryTwice {
throw Exception()
}
}
}