[FE 1.0] Don't fail candidates which were marked with compatibility resolve previously

^KT-52431 Fixed
^KT-52393 Fixed
This commit is contained in:
Victor Petukhov
2022-05-20 14:09:22 +02:00
committed by teamcity
parent 73d676d9de
commit 02a430875f
17 changed files with 198 additions and 23 deletions
@@ -581,10 +581,10 @@ internal object CheckIncompatibleTypeVariableUpperBounds : ResolutionStage() {
val upperTypes = variableWithConstraints.constraints.extractUpperTypesToCheckIntersectionEmptiness()
// TODO: consider reporting errors on bounded type variables by incompatible types but with other lower constraints
if (
variableWithConstraints.constraints.none { it.kind.isLower() }
&& upperTypes.computeEmptyIntersectionTypeKind().isDefinitelyEmpty()
) {
if (upperTypes.size <= 1 || variableWithConstraints.constraints.any { it.kind.isLower() })
continue
if (upperTypes.computeEmptyIntersectionTypeKind().isDefinitelyEmpty()) {
sink.yieldDiagnostic(
@Suppress("UNCHECKED_CAST")
InferredEmptyIntersectionDiagnostic(