[FIR] Implement properties types mismatch on inheritence
PROPERTY_TYPE_MISMATCH_ON_INHERITANCE, VAR_TYPE_MISMATCH_ON_INHERITANCE, PROPERTY_TYPE_MISMATCH_BY_DELEGATION
This commit is contained in:
committed by
teamcityserver
parent
8c7ee0b714
commit
c98cd3b190
-19
@@ -1,19 +0,0 @@
|
||||
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!>class Broken2<!>(val b: IBase2) : IBase2 by b, IDerived2()
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface IBase1 {
|
||||
fun foo(): Any
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,4 +16,4 @@ interface IDerived2 {
|
||||
val foo: String
|
||||
}
|
||||
|
||||
class Broken2(val b: IBase2) : IBase2 by b, IDerived2
|
||||
<!PROPERTY_TYPE_MISMATCH_BY_DELEGATION!>class Broken2<!>(val b: IBase2) : IBase2 by b, IDerived2
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
interface IBase1 {
|
||||
fun foo(): Any
|
||||
}
|
||||
|
||||
interface IDerived1 : IBase1 {
|
||||
override fun foo(): String
|
||||
}
|
||||
|
||||
<!RETURN_TYPE_MISMATCH_BY_DELEGATION!>class Broken1<!>(val b: IBase1) : IBase1 by b, IDerived1
|
||||
|
||||
interface IBase2 {
|
||||
val foo: Any
|
||||
}
|
||||
|
||||
interface IDerived2 : IBase2 {
|
||||
override val foo: String
|
||||
}
|
||||
|
||||
class Broken2(val b: IBase2) : IBase2 by b, IDerived2
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface IBase1 {
|
||||
fun foo(): Any
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user