FIR: tolerate comparison of an intersection of incompatible types
Previously, if user compares an `it<String, Int>` with `String`, the checker reports it since the flattened types `[String, Int, Int]` are incompatible. But technically, before flattening, the intersection type actually contain the other side, so they should really be compatible.
This commit is contained in:
committed by
teamcityserver
parent
b5ea811b9f
commit
e242ad955b
@@ -32,8 +32,8 @@ fun useEn2(x: En2) = x
|
||||
fun bar(x: Any) {
|
||||
if (x is En && x is En2) {
|
||||
when (x) {
|
||||
<!INCOMPATIBLE_TYPES!>En.A<!> -> useEn(x)
|
||||
<!INCOMPATIBLE_TYPES!>En2.D<!> -> useEn2(x)
|
||||
En.A -> useEn(x)
|
||||
En2.D -> useEn2(x)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user