Files
kotlin-fork/compiler/testData/codegen/box/defaultArguments/useNextParamInLambdaTailrec.kt
T
2021-11-20 03:37:31 +03:00

11 lines
309 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: don't support legacy feature. UNINITIALIZED_PARAMETER y. See KT-49800
tailrec fun foo(x: () -> String? = { y }, y: String = "fail"): String? {
if (y == "start")
return foo()
return x()
}
fun box() = foo(y = "start") ?: "OK"