Files
kotlin-fork/compiler/testData/codegen/boxInline/smap/tryFinally1.kt
T
Ivan Kylchik bb401c39d9 Add several new SMAP tests
Some of them are still failing and suppose to be
fixed later
2023-03-14 20:47:39 +00:00

32 lines
484 B
Kotlin
Vendored

// WITH_STDLIB
// FILE: 1.kt
inline fun g(block: () -> Unit) {
block()
}
var x: String? = null
fun compute(): String {
try {
for (a in listOf("a")) {
g {
for (b in listOf("b")) {
return b
}
}
}
} finally {
x = "OK"
}
return "FAIL"
}
// FILE: 2.kt
fun box(): String {
val result = compute()
if (result == "FAIL") return result
return x ?: "FAIL"
}