JVM_IR KT-36853 patch parents after tailrecPhase
This commit is contained in:
committed by
TeamCityServer
parent
34f8c7a68b
commit
ac6232b4ba
@@ -0,0 +1,33 @@
|
||||
// IGNORE_BACKEND: JS_IR, WASM
|
||||
|
||||
interface IFoo {
|
||||
fun foo(): String
|
||||
}
|
||||
|
||||
tailrec fun tailrecDefault(
|
||||
fake: Int,
|
||||
x: IFoo = object : IFoo {
|
||||
tailrec fun tailrecDefaultNested(
|
||||
b: Boolean,
|
||||
y: IFoo = object: IFoo {
|
||||
override fun foo() = "OK"
|
||||
}
|
||||
): String {
|
||||
return if (b)
|
||||
tailrecDefaultNested(false)
|
||||
else
|
||||
y.foo()
|
||||
}
|
||||
|
||||
override fun foo(): String {
|
||||
return tailrecDefaultNested(true)
|
||||
}
|
||||
}
|
||||
): String {
|
||||
return if (fake == 0)
|
||||
tailrecDefault(1)
|
||||
else
|
||||
x.foo()
|
||||
}
|
||||
|
||||
fun box(): String = tailrecDefault(0)
|
||||
Reference in New Issue
Block a user