@@ -2229,7 +2229,7 @@ ConstraintSystem::matchDeepEqualityTypes(Type type1, Type type2,
2229
2229
2230
2230
SmallVector<unsigned , 4 > mismatches;
2231
2231
auto result = matchDeepTypeArguments (
2232
- *this , subflags, args1, args2, locator,
2232
+ *this , subflags | TMF_ApplyingFix , args1, args2, locator,
2233
2233
[&mismatches](unsigned position) { mismatches.push_back (position); });
2234
2234
2235
2235
if (mismatches.empty ())
@@ -4270,6 +4270,24 @@ bool ConstraintSystem::repairFailures(
4270
4270
break ;
4271
4271
}
4272
4272
4273
+ case ConstraintLocator::GenericArgument: {
4274
+ // If any of the types is a hole, consider it fixed.
4275
+ if (lhs->isHole () || rhs->isHole ())
4276
+ return true ;
4277
+
4278
+ // Ignoring the generic argument because we may have a generic requirement
4279
+ // failure e.g. `String bind T.Element`, so let's drop the generic argument
4280
+ // path element and recurse in repairFailures to check and potentially
4281
+ // record the requirement failure fix.
4282
+ path.pop_back ();
4283
+
4284
+ if (path.empty () || !path.back ().is <LocatorPathElt::AnyRequirement>())
4285
+ break ;
4286
+
4287
+ return repairFailures (lhs, rhs, matchKind, conversionsOrFixes,
4288
+ getConstraintLocator (anchor, path));
4289
+ }
4290
+
4273
4291
default :
4274
4292
break ;
4275
4293
}
0 commit comments