Overridden functions using default arguments in recursive call are no more considered tail recursive #KT-4285 Fixed
This commit is contained in:
+11
@@ -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")
|
||||
Reference in New Issue
Block a user