Files
kotlin-fork/compiler/testData/cfg/tailCalls/sum.kt
T
2015-09-04 17:23:26 +03:00

4 lines
112 B
Kotlin
Vendored

tailrec fun sum(x: Long, sum: Long): Long {
if (x == 0.toLong()) return sum
return sum(x - 1, sum + x)
}