7c63d50d1c
This is needed so that SharedVariablesLowering doesn't get confused, and SharedVariablesLowering should run after TailrecLowering to properly optimize tailrec calls in inline lambdas.
18 lines
293 B
Kotlin
Vendored
18 lines
293 B
Kotlin
Vendored
interface IFoo {
|
|
fun foo(): String
|
|
}
|
|
|
|
tailrec fun tailrecDefault(
|
|
fake: Int,
|
|
x: IFoo = object : IFoo {
|
|
override fun foo(): String = "OK"
|
|
}
|
|
): String {
|
|
return if (fake == 0)
|
|
tailrecDefault(1)
|
|
else
|
|
x.foo()
|
|
}
|
|
|
|
fun box(): String = tailrecDefault(0)
|