mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] Avoid recording duplicate fixes for contextual type mismatch
This commit is contained in:
@@ -3877,6 +3877,11 @@ bool ConstraintSystem::repairFailures(
|
||||
if (lhs->isTypeVariableOrMember() || rhs->isTypeVariableOrMember())
|
||||
break;
|
||||
|
||||
// If there is already a fix for contextual failure, let's not
|
||||
// record a duplicate one.
|
||||
if (hasFixFor(getConstraintLocator(locator)))
|
||||
return true;
|
||||
|
||||
auto purpose = getContextualTypePurpose(anchor);
|
||||
if (rhs->isVoid() &&
|
||||
(purpose == CTP_ReturnStmt || purpose == CTP_ReturnSingleExpr)) {
|
||||
|
||||
Reference in New Issue
Block a user