[FIR] KT-55552: Report type mismatch for delegated properties

^KT-55552 Fixed
This commit is contained in:
Nikolay Lunyak
2023-05-12 14:05:57 +03:00
committed by Space Team
parent 81d955a712
commit f94c795b5b
7 changed files with 49 additions and 32 deletions
@@ -1,13 +0,0 @@
// ISSUE: KT-55552
interface B2 {
fun d()
}
class B
open class C(b: B) : B2 by b {} //no error in K2, K1 - [TYPE_MISMATCH] Type mismatch: inferred type is B but B2 was expected
fun main() {
val c = C(B()).d() //runtime AbstractMethodError
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// ISSUE: KT-55552
interface B2 {
@@ -1,18 +0,0 @@
// FILE: J.java
import org.jetbrains.annotations.*;
import java.util.*;
public class J {
@NotNull
public static List<String> staticNN;
@Nullable
public static List<String> staticN;
public static List<String> staticJ;
}
// FILE: k.kt
class A : List<String> by J.staticNN
class B : List<String> by J.staticN
class C : List<String> by J.staticJ
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: J.java
import org.jetbrains.annotations.*;