@@ -7051,8 +7051,8 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
70517051 llvm_unreachable (" Unhandled DeclTypeCheckingSemantics in switch." );
70527052 };
70537053
7054- // Save the original potentially lvalue function for rewriting call method
7055- // applications.
7054+ // Save the original potentially lvalue function for rewriting
7055+ // `callAsFunction` method applications.
70567056 auto *originalFn = fn;
70577057 // The function is always an rvalue.
70587058 fn = cs.coerceToRValue (fn);
@@ -7200,19 +7200,19 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
72007200 return finishApply (apply, openedType, locator);
72017201 }
72027202
7203- // Handle call method applications.
7203+ // Handle `callAsFunction` method applications.
72047204 auto &ctx = cs.getASTContext ();
72057205
72067206 TupleExpr *arg = dyn_cast<TupleExpr>(apply->getArg ());
72077207 if (auto parenExpr = dyn_cast<ParenExpr>(apply->getArg ()))
72087208 arg = TupleExpr::createImplicit (ctx, parenExpr->getSubExpr (), {});
72097209
7210- // Get resolved call method and verify it.
7210+ // Get resolved `callAsFunction` method and verify it.
72117211 auto loc = locator.withPathElement (ConstraintLocator::ApplyFunction);
72127212 auto selected = solution.getOverloadChoice (cs.getConstraintLocator (loc));
72137213 auto choice = selected.choice ;
72147214 auto *callMethod = dyn_cast<FuncDecl>(selected.choice .getDecl ());
7215- if (callMethod && callMethod->isCallFunction ()) {
7215+ if (callMethod && callMethod->isCallAsFunctionMethod ()) {
72167216 auto methodType =
72177217 simplifyType (selected.openedType )->castTo <AnyFunctionType>();
72187218 auto selfParam = callMethod->getImplicitSelfDecl ();
@@ -7227,7 +7227,7 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
72277227 failure.diagnose ();
72287228 return nullptr ;
72297229 }
7230- // Create direct reference to call method.
7230+ // Create direct reference to `callAsFunction` method.
72317231 bool isDynamic = choice.getKind () == OverloadChoiceKind::DeclViaDynamic;
72327232 Expr *declRef = buildMemberRef (originalFn, selected.openedFullType ,
72337233 /* dotLoc=*/ SourceLoc (), choice,
@@ -7240,7 +7240,7 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
72407240 return nullptr ;
72417241 declRef->setImplicit (apply->isImplicit ());
72427242 apply->setFn (declRef);
7243- // Coerce argument to input type of call method.
7243+ // Coerce argument to input type of the `callAsFunction` method.
72447244 SmallVector<Identifier, 2 > argLabelsScratch;
72457245 auto *arg = coerceCallArguments (apply->getArg (), methodType, apply,
72467246 apply->getArgumentLabels (argLabelsScratch),
0 commit comments