@@ -3356,13 +3356,19 @@ bool ConstraintSystem::repairFailures(
3356
3356
// related to immutability, otherwise it's a type mismatch.
3357
3357
auto result = matchTypes (lhs, rhs, ConstraintKind::Conversion,
3358
3358
TMF_ApplyingFix, locator);
3359
-
3359
+
3360
+ auto *loc = getConstraintLocator (locator);
3360
3361
if (getType (destExpr)->is <LValueType>() || result.isFailure ()) {
3361
- conversionsOrFixes.push_back (IgnoreAssignmentDestinationType::create (
3362
- *this , lhs, rhs, getConstraintLocator (locator)));
3362
+ // Let this asignment failure be diagnosed by the AllowTupleTypeMismatch
3363
+ // fix already recorded.
3364
+ if (hasFixFor (loc, FixKind::AllowTupleTypeMismatch))
3365
+ return true ;
3366
+
3367
+ conversionsOrFixes.push_back (
3368
+ IgnoreAssignmentDestinationType::create (*this , lhs, rhs, loc));
3363
3369
} else {
3364
3370
conversionsOrFixes.push_back (
3365
- TreatRValueAsLValue::create (*this , getConstraintLocator (locator) ));
3371
+ TreatRValueAsLValue::create (*this , loc ));
3366
3372
}
3367
3373
3368
3374
return true ;
@@ -8865,11 +8871,16 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
8865
8871
CoerceToCheckedCast::attempt (*this , fromType, toType, loc))
8866
8872
return !recordFix (fix, impact);
8867
8873
}
8868
-
8874
+
8875
+ // We already have a fix for this locator indicating a
8876
+ // tuple mismatch.
8877
+ if (hasFixFor (loc, FixKind::AllowTupleTypeMismatch))
8878
+ return true ;
8879
+
8869
8880
if (restriction == ConversionRestrictionKind::ValueToOptional ||
8870
8881
restriction == ConversionRestrictionKind::OptionalToOptional)
8871
8882
++impact;
8872
-
8883
+
8873
8884
auto *fix =
8874
8885
loc->isLastElement <LocatorPathElt::ApplyArgToParam>()
8875
8886
? AllowArgumentMismatch::create (*this , fromType, toType, loc)
0 commit comments