K1: report ABSTRACT_SUPER_CALL(_WARNING) also for 2+ steps to intersection
#KT-53953 Fixed
This commit is contained in:
Vendored
+10
-1
@@ -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<!>()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user