Move tailrecPhase before defaultArgumentStubPhase

So that default values can be copied to the recursive call sites.
This commit is contained in:
Ting-Yuan Huang
2019-05-20 14:11:29 -07:00
committed by max-kammerer
parent 6addb24e4b
commit bdcd6f73b1
15 changed files with 193 additions and 2 deletions
@@ -0,0 +1,15 @@
// 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"
}