mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
16 lines
381 B
Kotlin
Vendored
16 lines
381 B
Kotlin
Vendored
object O {
|
|
// This is correct, foo is the same
|
|
tailrec fun foo(i: Int): Int = if (i < 0) 0 else O.foo(i - 1)
|
|
}
|
|
|
|
class A {
|
|
<!NO_TAIL_CALLS_FOUND!>tailrec fun foo(i: Int)<!> = if (i < 0) 0 else A.foo(i - 1)
|
|
|
|
companion object {
|
|
fun foo(i: Int) = 42 + i
|
|
}
|
|
}
|
|
|
|
class B {
|
|
<!NO_TAIL_CALLS_FOUND!>tailrec fun foo(i: Int)<!> = if (i < 0) 0 else O.foo(i - 1)
|
|
} |