These functions don't need a TypeChecker

This commit is contained in:
Hamish Knight
2019-10-18 12:57:59 -07:00
parent 8b9cced36b
commit be23ecc878
5 changed files with 35 additions and 43 deletions

View File

@@ -5218,7 +5218,7 @@ performMemberLookup(ConstraintKind constraintKind, DeclName memberName,
if (memberLocator &&
::hasDynamicMemberLookupAttribute(instanceTy,
DynamicMemberLookupCache) &&
isValidKeyPathDynamicMemberLookup(subscript, TC)) {
isValidKeyPathDynamicMemberLookup(subscript)) {
auto info = getArgumentInfo(memberLocator);
if (!(info && info->Labels.size() == 1 &&
@@ -5324,9 +5324,9 @@ performMemberLookup(ConstraintKind constraintKind, DeclName memberName,
auto name = memberName.getBaseIdentifier();
for (const auto &candidate : subscripts.ViableCandidates) {
auto *SD = cast<SubscriptDecl>(candidate.getDecl());
bool isKeyPathBased = isValidKeyPathDynamicMemberLookup(SD, TC);
bool isKeyPathBased = isValidKeyPathDynamicMemberLookup(SD);
if (isValidStringDynamicMemberLookup(SD, DC, TC) || isKeyPathBased)
if (isValidStringDynamicMemberLookup(SD, DC) || isKeyPathBased)
result.addViable(OverloadChoice::getDynamicMemberLookup(
baseTy, SD, name, isKeyPathBased));
}
@@ -5335,7 +5335,7 @@ performMemberLookup(ConstraintKind constraintKind, DeclName memberName,
auto *SD =
cast<SubscriptDecl>(subscripts.UnviableCandidates[index].getDecl());
auto choice = OverloadChoice::getDynamicMemberLookup(
baseTy, SD, name, isValidKeyPathDynamicMemberLookup(SD, TC));
baseTy, SD, name, isValidKeyPathDynamicMemberLookup(SD));
result.addUnviable(choice, subscripts.UnviableReasons[index]);
}
}
@@ -7094,7 +7094,7 @@ lookupDynamicCallableMethods(Type type, ConstraintSystem &CS,
auto candidates = matches.ViableCandidates;
auto filter = [&](OverloadChoice choice) {
auto cand = cast<FuncDecl>(choice.getDecl());
return !isValidDynamicCallableMethod(cand, decl, CS.TC, hasKeywordArgs);
return !isValidDynamicCallableMethod(cand, decl, hasKeywordArgs);
};
candidates.erase(
std::remove_if(candidates.begin(), candidates.end(), filter),