Files
kotlin/compiler/testData/codegen/box/controlStructures/tryCatchInExpressions/deadTryCatch.kt
Mikhael Bogdanov 494828f4cf Unmute jvm ir-tests
2018-08-15 10:26:28 +03:00

26 lines
433 B
Kotlin
Vendored

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