EmptyIntersectionTypeChecker: don't take stub & error types into account

This commit fixes some tests broken by previous refactorings
This commit is contained in:
Mikhail Glukhikh
2022-12-07 13:27:12 +01:00
committed by Space Team
parent a7840d10d4
commit 26ff806440
@@ -109,6 +109,10 @@ internal object EmptyIntersectionTypeChecker {
).isNotEmpty()
private fun TypeSystemInferenceExtensionContext.mayCauseEmptyIntersection(type: KotlinTypeMarker): Boolean {
if (type.lowerBoundIfFlexible().isStubType() || type.isError()) {
return false
}
val typeConstructor = type.typeConstructor()
if (!typeConstructor.isClassTypeConstructor() && !typeConstructor.isTypeParameterTypeConstructor())