@@ -1026,7 +1026,6 @@ swift::matchWitness(WitnessChecker::RequirementEnvironmentCache &reqEnvCache,
1026
1026
1027
1027
// Initialized by the setup operation.
1028
1028
std::optional<ConstraintSystem> cs;
1029
- ConstraintLocator *locator = nullptr ;
1030
1029
ConstraintLocator *reqLocator = nullptr ;
1031
1030
ConstraintLocator *witnessLocator = nullptr ;
1032
1031
Type witnessType, openWitnessType;
@@ -1151,8 +1150,6 @@ swift::matchWitness(WitnessChecker::RequirementEnvironmentCache &reqEnvCache,
1151
1150
1152
1151
// Open up the witness type.
1153
1152
witnessType = witness->getInterfaceType ();
1154
- // FIXME: witness as a base locator?
1155
- locator = cs->getConstraintLocator ({});
1156
1153
witnessLocator =
1157
1154
cs->getConstraintLocator (req, LocatorPathElt::Witness (witness));
1158
1155
if (witness->getDeclContext ()->isTypeContext ()) {
@@ -1211,7 +1208,8 @@ swift::matchWitness(WitnessChecker::RequirementEnvironmentCache &reqEnvCache,
1211
1208
}
1212
1209
}
1213
1210
1214
- cs->addConstraint (ConstraintKind::Bind, reqType, witnessType, locator);
1211
+ cs->addConstraint (ConstraintKind::Bind, reqType, witnessType,
1212
+ witnessLocator);
1215
1213
// FIXME: Check whether this has already failed.
1216
1214
return std::nullopt;
1217
1215
};
0 commit comments