3d8d92c7d3
- test data files renamed from *.jet to *.kt
31 lines
562 B
Kotlin
31 lines
562 B
Kotlin
//KT-559 Forbid abstract method call through super
|
|
|
|
package kt559
|
|
|
|
abstract class A {
|
|
abstract val i : Int
|
|
|
|
abstract fun foo() : Int
|
|
|
|
fun fff() {}
|
|
}
|
|
|
|
abstract class D(): A() {
|
|
override val i : Int = 34
|
|
}
|
|
|
|
class <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>C<!>() : D() {
|
|
fun test() {
|
|
super.i
|
|
}
|
|
}
|
|
|
|
class <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>B<!>() : A() {
|
|
override fun foo(): Int {
|
|
super.<!ABSTRACT_SUPER_CALL!>i<!>
|
|
|
|
super.fff() //everything is ok
|
|
return super.<!ABSTRACT_SUPER_CALL!>foo()<!> //no error!!
|
|
}
|
|
}
|