Don't allow fake override to inherit implementation with wrong return type

#KT-4763 Fixed
This commit is contained in:
Alexander Udalov
2014-03-28 23:09:52 +04:00
parent 05a04293ab
commit 9760f30c99
10 changed files with 128 additions and 18 deletions
@@ -0,0 +1,27 @@
// !DIAGNOSTICS_NUMBER: 1
// !DIAGNOSTICS: ABSTRACT_MEMBER_NOT_IMPLEMENTED
// !MESSAGE_TYPE: TEXT
trait T1
trait T2 : T1
trait T3 : T2
trait T4 : T3
trait A {
fun f(): T1
}
trait B {
fun f(): T2 = null!!
}
trait C {
fun f(): T3
}
abstract class D {
abstract fun f(): T4
}
class E : A, B, C, D()
@@ -0,0 +1,2 @@
<!-- wrongReturnTypeInImplementation1 -->
Class 'E' must be declared abstract or implement abstract member internal abstract fun f(): T3 defined in C