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

25 lines
386 B
Kotlin
Vendored

// This test checks that bytecode optimizer doesn't crash on unreachable code.
fun box(): String {
try {
remove()
}
catch (e: Exception) {
return e.message!!
}
return "Should fail with exception"
}
fun remove() {
throw Exception("OK")
var captured = 0
debug {
captured = 1
}
}
private fun debug(f: () -> Unit) {
f()
}