mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #29011 from LucianoPAlmeida/coercion-handle-contextual-mismatch
[Diagnostics] Handle CoerceExpr conversion failure in contextual mismatch
This commit is contained in:
@@ -2823,6 +2823,15 @@ bool ConstraintSystem::repairFailures(
|
||||
conversionsOrFixes.push_back(coerceToCheckCastFix);
|
||||
return true;
|
||||
}
|
||||
|
||||
// If it has a deep equality restriction, defer the diagnostic to
|
||||
// GenericMismatch.
|
||||
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