Skip to content

Commit 9452c60

Browse files
committed
Sema: Remove CSApply's getNaturalArgumentCount() in favor of getNumCurryLevels()
1 parent 90ee606 commit 9452c60

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -616,21 +616,6 @@ namespace {
616616
return !isa<FuncDecl>(member) || !cast<FuncDecl>(member)->isMutating();
617617
}
618618

619-
unsigned getNaturalArgumentCount(ValueDecl *member) {
620-
if (isa<AbstractFunctionDecl>(member)) {
621-
// For functions, close the existential once the function
622-
// has been fully applied.
623-
return 2;
624-
} else {
625-
// For storage, close the existential either when it's
626-
// accessed (if it's an rvalue only) or when it is loaded or
627-
// stored (if it's an lvalue).
628-
assert(isa<AbstractStorageDecl>(member) &&
629-
"unknown member when opening existential");
630-
return 1;
631-
}
632-
}
633-
634619
/// If the expression might be a dynamic method call, return the base
635620
/// value for the call.
636621
Expr *getBaseExpr(Expr *expr) {
@@ -730,7 +715,7 @@ namespace {
730715

731716
// Determine the number of applications that need to occur before
732717
// we can close this existential, and record it.
733-
unsigned maxArgCount = getNaturalArgumentCount(member);
718+
unsigned maxArgCount = member->getNumCurryLevels();
734719
unsigned depth = ExprStack.size() - getArgCount(maxArgCount);
735720

736721
// Invalid case -- direct call of a metatype. Has one less argument

0 commit comments

Comments
 (0)