Overridden functions using default arguments in recursive call are no more considered tail recursive #KT-4285 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-05-16 18:51:16 +03:00
parent f35fd32a25
commit a4ad995f31
7 changed files with 113 additions and 0 deletions
@@ -0,0 +1,11 @@
open class A {
open fun foo(s: String = "OK") = s
}
class B : A() {
<!NO_TAIL_CALLS_FOUND!>override tailrec fun foo(s: String): String<!> {
return if (s == "OK") s else foo()
}
}
fun box() = B().foo("FAIL")