Files
kotlin-fork/compiler/testData/codegen/boxInline/complexStack/spillConstructorArgumentsAndInlineLambdaParameter.kt
T
Jinseong Jeon 922419efb8 FIR CFG: route to exit of try main for throw in try main
to make the remaining part of try main marked as dead.

^KT-45475 Fixed
2021-03-16 15:11:56 +03:00

24 lines
454 B
Kotlin
Vendored

// IGNORE_FIR_DIAGNOSTICS
// FILE: 1.kt
class A(val s: String)
inline fun inlineMe(limit: Int, c: (String) -> String): A {
var index = 0
var res: A?
while (true) {
res = A(c(try {
throw IllegalStateException("")
} catch (ignored: Throwable) {
"OK"
})
)
if (index++ == limit) break
}
return res!!
}
// FILE: 2.kt
fun box(): String {
return inlineMe(1) { "OK" }.s
}