K1: report ABSTRACT_SUPER_CALL(_WARNING) also for 2+ steps to intersection

#KT-53953 Fixed
This commit is contained in:
Mikhail Glukhikh
2022-09-15 09:42:22 +02:00
committed by Space
parent 3e5d5bcaa7
commit c4a48927d2
4 changed files with 50 additions and 26 deletions
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: -ForbidSuperDelegationToAbstractFakeOverride
interface Foo {
fun check(): String = "OK"
@@ -9,8 +10,16 @@ abstract class Base {
abstract class Derived : Base(), Foo
abstract class Derived2 : Derived() // ONE MORE LEVEL
abstract class Derived3 : Derived2()
class Problem : Derived2() {
override fun check(): String {
return super.check() // NO COMPILER ERROR, BUT FAILURE IN RUNTIME
return super.<!ABSTRACT_SUPER_CALL_WARNING!>check<!>()
}
}
class Problem2 : Derived3() {
override fun check(): String {
return super.<!ABSTRACT_SUPER_CALL_WARNING!>check<!>()
}
}