blob: a46570c3316f3430cbd9eb6f1d43bfecb369b294 [file]
// RUN_PIPELINE_TILL: BACKEND
// FIR_IDENTICAL
object O {
// tailrec since `O` is a singleton
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)
}
/* GENERATED_FIR_TAGS: additiveExpression, classDeclaration, companionObject, comparisonExpression, functionDeclaration,
ifExpression, integerLiteral, objectDeclaration, tailrec */