FIR Checker: check tailrec
Difference from FE1.0 * KT-4285: calls to virtual method with default argument should be reported as not tailrec. FE1.0 is missing such cases. * KT-48600: calls inside lambda should be reported as not tailrec. FE1.0 also misses such cases.
This commit is contained in:
committed by
TeamCityServer
parent
5df316a129
commit
8525b4932b
@@ -0,0 +1,21 @@
|
||||
// FIR_IDENTICAL
|
||||
class A(val a: A) {
|
||||
<!NO_TAIL_CALLS_FOUND!>tailrec fun foo1()<!> {
|
||||
a.<!NON_TAIL_RECURSIVE_CALL!>foo1<!>()
|
||||
}
|
||||
|
||||
tailrec fun foo2() {
|
||||
this.foo2()
|
||||
}
|
||||
|
||||
tailrec fun foo3() {
|
||||
foo3()
|
||||
}
|
||||
|
||||
<!NO_TAIL_CALLS_FOUND!>tailrec fun foo4()<!> {
|
||||
with(a) {
|
||||
<!NON_TAIL_RECURSIVE_CALL!>foo4<!>()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user