[ConstraintLocator] Add special locator for synthesized arguments

This commit is contained in:
Pavel Yaskevich
2019-02-25 14:53:08 -08:00
parent 0b12c664b0
commit 1c54c5a08b
3 changed files with 19 additions and 2 deletions

View File

@@ -1264,8 +1264,8 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
if (diff < 0) {
for (unsigned i = func1Params.size(),
n = func2Params.size(); i != n; ++i) {
auto *argLoc =
getConstraintLocator(anchor, LocatorPathElt::getTupleElement(i));
auto *argLoc = getConstraintLocator(
anchor, LocatorPathElt::getSynthesizedArgument(i));
auto arg = func2Params[i].withType(createTypeVariable(argLoc));
func1Params.push_back(arg);