Files
kotlin-fork/compiler/testData/diagnostics/tests/delegation/covariantOverrides/fromClass.kt
T
2019-02-14 12:31:42 +03:00

20 lines
505 B
Kotlin
Vendored

interface IBase1 {
fun foo(): Any
}
open class IDerived1 : IBase1 {
override fun foo(): String = "1"
}
<!DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE, RETURN_TYPE_MISMATCH_BY_DELEGATION!>class Broken1<!>(val b: IBase1) : IBase1 by b, IDerived1()
interface IBase2 {
val foo: Any
}
open class IDerived2 : IBase2 {
override val foo: String = "2"
}
<!DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE, PROPERTY_TYPE_MISMATCH_BY_DELEGATION!>class Broken2<!>(val b: IBase2) : IBase2 by b, IDerived2()