Skip to content

Commit 533d9ac

Browse files
[CSSimplify] Fallback to contextual mismatch in repair failures for CoerceExpr
1 parent 475b559 commit 533d9ac

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,6 +2823,16 @@ bool ConstraintSystem::repairFailures(
28232823
conversionsOrFixes.push_back(coerceToCheckCastFix);
28242824
return true;
28252825
}
2826+
2827+
// If it has a deep equality restriction defer the diagnostic to a
2828+
// GenericMismatch fix.
2829+
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality)) {
2830+
return false;
2831+
}
2832+
2833+
auto *fix = ContextualMismatch::create(*this, lhs, rhs,
2834+
getConstraintLocator(locator));
2835+
conversionsOrFixes.push_back(fix);
28262836
}
28272837

28282838
// This could be:

0 commit comments

Comments
 (0)