Skip to content

Commit d91ba3c

Browse files
committed
[Sema] Respect other ApplyExprs’ call parens
PreCheckExpression was not treating the implicit call parens on unary or binary operator applications like the explicit parens on CallExpr applications. Now it will. This prevents various forms of mischief, like having them subsumed into a TypeExpr.
1 parent 6cfcd4c commit d91ba3c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,8 +986,10 @@ namespace {
986986

987987
std::pair<bool, Expr *> walkToExprPre(Expr *expr) override {
988988
// If this is a call, record the argument expression.
989-
if (auto call = dyn_cast<CallExpr>(expr)) {
990-
CallArgs.insert(call->getArg());
989+
if (auto call = dyn_cast<ApplyExpr>(expr)) {
990+
if (!isa<SelfApplyExpr>(expr)) {
991+
CallArgs.insert(call->getArg());
992+
}
991993
}
992994

993995
// If this is an unresolved member with a call argument (e.g.,

0 commit comments

Comments
 (0)