Files
kotlin/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgs2.kt
Ting-Yuan Huang bdcd6f73b1 Move tailrecPhase before defaultArgumentStubPhase
So that default values can be copied to the recursive call sites.
2019-05-24 09:51:07 +02:00

15 lines
272 B
Kotlin
Vendored

// DONT_RUN_GENERATED_CODE: JS
tailrec fun test(x : Int = 0, e : Any = "a") {
if (x < 100000 && !e.equals("a")) {
throw IllegalArgumentException()
}
if (x > 0) {
test(x - 1)
}
}
fun box() : String {
test(100000, "b")
return "OK"
}