Files
kotlin/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithoutAnnotation.kt
2018-04-19 13:17:28 +03:00

14 lines
259 B
Kotlin
Vendored

// DONT_RUN_GENERATED_CODE: JS
fun withoutAnnotation(x : Int) : Int {
if (x > 0) {
return 1 + withoutAnnotation(x - 1)
}
return 0
}
fun box(): String {
val r = withoutAnnotation(10)
if (r == 10) return "OK"
return "Fail $r"
}