Files
kotlin/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/functionWithoutAnnotation.kt
Svetlana Isakova b71260f54e Moved tests
that are used both for codegen & diagnostics to codegen/box/diagnostics
2014-11-21 14:02:45 +03:00

12 lines
227 B
Kotlin

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"
}