[FIR2IR] Approximate non-denotable types when converting ConeType to IrType

This commit is contained in:
Dmitriy Novozhilov
2021-02-27 15:19:23 +03:00
committed by TeamCityServer
parent c271f953d7
commit da0fd7cc15
31 changed files with 147 additions and 325 deletions
@@ -485,7 +485,11 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext, ConeTypeCo
firstCandidate: KotlinTypeMarker,
secondCandidate: KotlinTypeMarker
): KotlinTypeMarker {
// TODO
return firstCandidate
require(firstCandidate is ConeKotlinType)
require(secondCandidate is ConeKotlinType)
val intersectionType = firstCandidate.lowerBoundIfFlexible() as? ConeIntersectionType ?: error {
"Expected type is intersection, found $firstCandidate"
}
return intersectionType.withAlternative(secondCandidate)
}
}