[CS] NFC: Factor out AllowAssociatedValueMismatch

This seems better suited as its own fix, rather
than as part of ContextualMismatch.
This commit is contained in:
Hamish Knight
2023-05-04 14:36:15 +01:00
parent ba2c5e7d35
commit 91209d4226
5 changed files with 63 additions and 27 deletions

View File

@@ -6380,8 +6380,7 @@ bool ConstraintSystem::repairFailures(
if (isMemberMatch) {
recordAnyTypeVarAsPotentialHole(lhs);
recordAnyTypeVarAsPotentialHole(rhs);
conversionsOrFixes.push_back(ContextualMismatch::create(
conversionsOrFixes.push_back(AllowAssociatedValueMismatch::create(
*this, lhs, rhs, getConstraintLocator(locator)));
}
@@ -14572,6 +14571,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
case FixKind::AllowInvalidPackExpansion:
case FixKind::MacroMissingPound:
case FixKind::AllowGlobalActorMismatch:
case FixKind::AllowAssociatedValueMismatch:
case FixKind::GenericArgumentsMismatch: {
return recordFix(fix) ? SolutionKind::Error : SolutionKind::Solved;
}