ConeTypeIntersector: preserve raw & dynamic types as is

This commit is contained in:
Mikhail Glukhikh
2023-01-03 18:03:21 +01:00
committed by Space Team
parent 55fdb43620
commit 1344a9b1bb
8 changed files with 115 additions and 1 deletions
@@ -27,7 +27,8 @@ object ConeTypeIntersector {
}
}
if (inputTypes.any { it is ConeFlexibleType }) {
// Note: we aren't sure how to intersect raw & dynamic types properly (see KT-55762)
if (inputTypes.any { it is ConeFlexibleType } && inputTypes.none { it.isRaw() || it is ConeDynamicType }) {
// (A..B) & C = (A & C)..(B & C)
val lowerBound = intersectTypes(context, inputTypes.map { it.lowerBoundIfFlexible() })
val upperBound = intersectTypes(context, inputTypes.map { it.upperBoundIfFlexible() })