Files
kotlin-fork/compiler/testData/codegen/box/defaultArguments/useNextParamInLambdaTailrec.kt
T
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00

11 lines
315 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_K2: JVM_IR, JS_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"