Files
kotlin/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgsOverridden.kt
2019-11-19 11:00:09 +03:00

17 lines
410 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
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")