Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/controlStructures/tryCatchInExpressions/kt9644try.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

21 lines
367 B
Kotlin

inline fun doCall(f: () -> Any) = f()
fun test1() {
val localResult = doCall {
try { "1" } catch (e: Exception) { "2" }
return
}
}
fun test2(): String {
val localResult = doCall {
try { "1" } catch (e: Exception) { "2" }
return@test2 "OK"
}
return "Hmmm..."
}
fun box(): String {
test1()
return test2()
}