mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CSSimplify] Fallback to contextual mismatch in repair failures for CoerceExpr
This commit is contained in:
@@ -2823,6 +2823,16 @@ bool ConstraintSystem::repairFailures(
|
||||
conversionsOrFixes.push_back(coerceToCheckCastFix);
|
||||
return true;
|
||||
}
|
||||
|
||||
// If it has a deep equality restriction defer the diagnostic to a
|
||||
// GenericMismatch fix.
|
||||
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto *fix = ContextualMismatch::create(*this, lhs, rhs,
|
||||
getConstraintLocator(locator));
|
||||
conversionsOrFixes.push_back(fix);
|
||||
}
|
||||
|
||||
// This could be:
|
||||
|
||||
Reference in New Issue
Block a user