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

10 lines
223 B
Kotlin
Vendored

// DONT_RUN_GENERATED_CODE: JS
tailrec infix fun Int.test(x : Int) : Int {
if (this > 1) {
return (this - 1) test x
}
return this
}
fun box() : String = if (1000000.test(1000000) == 1) "OK" else "FAIL"