Gracefully handle erroneous super type during local type approximation

^KTIJ-23528 Fixed
This commit is contained in:
Jinseong Jeon
2022-11-09 23:13:34 -08:00
committed by Ilya Kirillov
parent f775778efa
commit c79d65536b
7 changed files with 44 additions and 4 deletions
@@ -179,8 +179,8 @@ abstract class AbstractTypeApproximator(
errorTypesEqualToAnything = false,
stubTypesEqualToAnything = false
)
return AbstractTypeChecker.findCorrespondingSupertypes(typeCheckerContext, type, superConstructor).first()
.withNullability(type.isMarkedNullable())
return AbstractTypeChecker.findCorrespondingSupertypes(typeCheckerContext, type, superConstructor).firstOrNull()
?.withNullability(type.isMarkedNullable())
}
private fun isIntersectionTypeEffectivelyNothing(constructor: IntersectionTypeConstructorMarker): Boolean {