Files
kotlin-fork/compiler/testData/diagnostics/tests/declarationChecks/kt559.jet
T
Stepan Koltsov 07ff53d456 add trailing newlines to test files
otherwise I have to rollback dozens of files after using sed that follows conventions
2012-03-12 22:54:14 +04:00

31 lines
562 B
Plaintext

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