Files
kotlin/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/defaultArgs.kt
Roman Artemev 8a871b3f0c Update tests
2018-08-31 15:34:18 +03:00

17 lines
304 B
Kotlin
Vendored

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