File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -5187,18 +5187,12 @@ bool ConstraintSystem::repairFailures(
5187
5187
// fix-up here unless last component has already a invalid type or
5188
5188
// instance fix recorded.
5189
5189
if (auto *kpExpr = getAsExpr<KeyPathExpr>(anchor)) {
5190
- auto i = kpExpr->getComponents().size() - 1;
5191
- auto lastCompLoc = getConstraintLocator(
5192
- locator.withPathElement(LocatorPathElt::KeyPathComponent(i)));
5193
- if (hasFixFor(lastCompLoc, FixKind::AllowTypeOrInstanceMember))
5194
- return true;
5195
-
5196
- auto lastComponentType = lhs->lookThroughAllOptionalTypes();
5197
- auto keyPathResultType = rhs->lookThroughAllOptionalTypes();
5198
-
5199
- // Propagate contextual information from/to keypath result type.
5200
- (void)matchTypes(lastComponentType, keyPathResultType, matchKind,
5201
- TMF_ApplyingFix, getConstraintLocator(locator));
5190
+ if (isKnownKeyPathType(lhs) && isKnownKeyPathType(rhs)) {
5191
+ // If we have keypath capabilities for both sides and one of the bases
5192
+ // is unresolved, it is too early to record fix.
5193
+ if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality))
5194
+ return false;
5195
+ }
5202
5196
5203
5197
conversionsOrFixes.push_back(IgnoreContextualType::create(
5204
5198
*this, lhs, rhs, getConstraintLocator(locator)));
You can’t perform that action at this time.
0 commit comments