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