Files
kotlin-fork/compiler/testData/codegen/box/diagnostics/functions/tailRecursion/extensionTailCall.kt
T
2018-10-17 18:33:52 +03:00

13 lines
204 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
// DONT_RUN_GENERATED_CODE: JS
tailrec fun Int.foo(x: Int) {
if (x == 0) return
return 1.foo(x - 1)
}
fun box(): String {
1.foo(1000000)
return "OK"
}