KT-559 Forbid abstract method call through super

This commit is contained in:
svtk
2012-01-27 11:48:51 +04:00
parent bff06b14a1
commit 1ed5471341
4 changed files with 52 additions and 5 deletions
@@ -0,0 +1,30 @@
//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!!
}
}