Files
kotlin-fork/compiler/testData/codegen/box/defaultArguments/kt46189.kt
T
pyos 7c63d50d1c IR: create more temporary vals when optimizing tailrec calls
This is needed so that SharedVariablesLowering doesn't get confused, and
SharedVariablesLowering should run after TailrecLowering to properly
optimize tailrec calls in inline lambdas.
2021-10-01 14:37:54 +02:00

14 lines
216 B
Kotlin
Vendored

class C
fun box(): String =
C().foo("O")
tailrec fun C.foo(
x: String,
f: (String) -> String = { bar(it) }
): String =
if (x.length < 2) foo(f(x)) else x
fun C.bar(s: String): String =
s + "K"