[FIR] KT-55552: Ensure type mismatch is missing

This commit is contained in:
Nikolay Lunyak
2023-05-12 11:19:42 +03:00
committed by Space Team
parent 56f977f70c
commit 81d955a712
7 changed files with 56 additions and 0 deletions
@@ -0,0 +1,13 @@
// 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
}
@@ -0,0 +1,13 @@
// ISSUE: KT-55552
interface B2 {
fun d()
}
class B
open class C(b: B) : B2 by <!TYPE_MISMATCH!>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
}