[FE] Cache checking intersection type emptiness results

This commit is contained in:
Victor Petukhov
2022-05-05 18:23:29 +02:00
committed by teamcity
parent 9a3b5e547b
commit e133ee3765
4 changed files with 27 additions and 8 deletions
@@ -584,7 +584,7 @@ internal object CheckIncompatibleTypeVariableUpperBounds : ResolutionStage() {
if (upperTypes.size <= 1 || variableWithConstraints.constraints.any { it.kind.isLower() })
continue
if (upperTypes.computeEmptyIntersectionTypeKind().isDefinitelyEmpty()) {
if (candidate.system.getEmptyIntersectionTypeKind(upperTypes).isDefinitelyEmpty()) {
sink.yieldDiagnostic(
@Suppress("UNCHECKED_CAST")
InferredEmptyIntersectionDiagnostic(