EmptyIntersectionTypeChecker: fix typo in variable name

This commit is contained in:
Mikhail Glukhikh
2022-11-24 17:21:37 +01:00
committed by Space Team
parent d5c8d9fecc
commit e9ea66b9f1
@@ -98,13 +98,13 @@ internal object EmptyIntersectionTypeChecker {
typeCheckerState, secondType.lowerBoundIfFlexible(), firstTypeConstructor typeCheckerState, secondType.lowerBoundIfFlexible(), firstTypeConstructor
).singleOrNull() ).singleOrNull()
val anyInference = firstTypeConstructor.isInterface() || secondTypeConstructor.isInterface() val atLeastOneInterface = firstTypeConstructor.isInterface() || secondTypeConstructor.isInterface()
// Two classes can't have a common subtype if neither is a subtype of another // Two classes can't have a common subtype if neither is a subtype of another
if (superTypeByFirstConstructor == null && superTypeBySecondConstructor == null && !anyInference) if (superTypeByFirstConstructor == null && superTypeBySecondConstructor == null && !atLeastOneInterface)
return EmptyIntersectionTypeInfo(EmptyIntersectionTypeKind.MULTIPLE_CLASSES, firstType, secondType) return EmptyIntersectionTypeInfo(EmptyIntersectionTypeKind.MULTIPLE_CLASSES, firstType, secondType)
if (anyInference) { if (atLeastOneInterface) {
val incompatibleSupertypes = getIncompatibleSuperTypes(firstType, secondType) val incompatibleSupertypes = getIncompatibleSuperTypes(firstType, secondType)
if (incompatibleSupertypes != null) { if (incompatibleSupertypes != null) {
return EmptyIntersectionTypeInfo(EmptyIntersectionTypeKind.INCOMPATIBLE_SUPERTYPES, *incompatibleSupertypes) return EmptyIntersectionTypeInfo(EmptyIntersectionTypeKind.INCOMPATIBLE_SUPERTYPES, *incompatibleSupertypes)