Files
kotlin/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/tailCallInBlockInParentheses.kt
2018-06-09 19:15:38 +03:00

15 lines
206 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
// DONT_RUN_GENERATED_CODE: JS
tailrec fun foo(x: Int) {
return if (x > 0) {
(foo(x - 1))
}
else Unit
}
fun box(): String {
foo(1000000)
return "OK"
}