Files
kotlin-fork/compiler/testData/diagnostics/tests/declarationChecks/kt559.kt
T
Andrey Breslav 3d8d92c7d3 JetDiagnosticsTest migrated to TestGenerator
- test data files renamed from *.jet to *.kt
2012-07-10 14:48:11 +04:00

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!!
}
}