IR: keep capture sets the same when copying objects for tailrec funs
tailrec f(x: () -> T = { y }, y: T = ...) = f()
-- at the call we know that in `x` the observed value of `y` is `null`,
but the constructor should still have a single parameter.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// IGNORE_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
tailrec fun foo(x: () -> String? = { y }, y: String = "fail"): String? {
|
||||
if (y == "start")
|
||||
return foo()
|
||||
return x()
|
||||
}
|
||||
|
||||
fun box() = foo(y = "start") ?: "OK"
|
||||
Reference in New Issue
Block a user