Merge pull request #39192 from hamishknight/a-range-of-arguments

[CS] Store argument list mappings on solutions
This commit is contained in:
Hamish Knight
2021-09-08 12:00:48 +01:00
committed by GitHub
6 changed files with 68 additions and 24 deletions

View File

@@ -917,7 +917,7 @@ namespace {
CS.getConstraintLocator(locator,
ConstraintLocator::FunctionResult);
associateArgumentList(memberLocator, argList);
CS.associateArgumentList(memberLocator, argList);
Type outputTy;
@@ -1174,7 +1174,7 @@ namespace {
Type visitObjectLiteralExpr(ObjectLiteralExpr *expr) {
auto *exprLoc = CS.getConstraintLocator(expr);
associateArgumentList(exprLoc, expr->getArgs());
CS.associateArgumentList(exprLoc, expr->getArgs());
// If the expression has already been assigned a type; just use that type.
if (expr->getType())
@@ -2687,7 +2687,7 @@ namespace {
Type visitApplyExpr(ApplyExpr *expr) {
auto fnExpr = expr->getFn();
associateArgumentList(CS.getConstraintLocator(expr), expr->getArgs());
CS.associateArgumentList(CS.getConstraintLocator(expr), expr->getArgs());
if (auto *UDE = dyn_cast<UnresolvedDotExpr>(fnExpr)) {
auto typeOperation = getTypeOperation(UDE, CS.getASTContext());
@@ -3442,11 +3442,6 @@ namespace {
}
llvm_unreachable("unhandled operation");
}
void associateArgumentList(ConstraintLocator *locator, ArgumentList *args) {
assert(locator && locator->getAnchor());
CS.ArgumentLists[CS.getArgumentInfoLocator(locator)] = args;
}
};
class ConstraintWalker : public ASTWalker {