Files
kotlin-fork/compiler/testData/codegen/box/defaultArguments/captureInTailrec.kt
T
2021-10-01 23:36:41 +03:00

12 lines
218 B
Kotlin
Vendored

// KT-46225
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"