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

31 lines
626 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
interface Callable {
fun call(b: Boolean)
}
inline fun run(f: () -> Unit) { f() }
class A {
fun foo(): String {
run {
val x = object : Callable {
override fun call(b: Boolean) {
if (b) {
x()
} else {
try {
x()
} catch(t: Throwable) {
}
}
}
}
}
return "OK"
}
private fun x() {}
}
fun box(): String =
A().foo()