@@ -991,10 +991,6 @@ namespace {
991
991
// / in simple pattern-like expressions, so we reject anything complex here.
992
992
void markAcceptableDiscardExprs (Expr *E);
993
993
994
- // / Check if this is a postfix '...' operator, which might denote a pack
995
- // / expansion expression.
996
- Expr *isPostfixEllipsisOperator (Expr *E);
997
-
998
994
public:
999
995
PreCheckExpression (DeclContext *dc, Expr *parent,
1000
996
bool replaceInvalidRefsWithErrors,
@@ -1468,7 +1464,7 @@ bool PreCheckExpression::exprLooksLikeAType(Expr *expr) {
1468
1464
isa<ForceValueExpr>(expr) ||
1469
1465
isa<ParenExpr>(expr) ||
1470
1466
isa<ArrowExpr>(expr) ||
1471
- isPostfixEllipsisOperator (expr) ||
1467
+ isa<PackExpansionExpr> (expr) ||
1472
1468
isa<TupleExpr>(expr) ||
1473
1469
(isa<ArrayExpr>(expr) &&
1474
1470
cast<ArrayExpr>(expr)->getElements ().size () == 1 ) ||
@@ -1667,28 +1663,6 @@ VarDecl *PreCheckExpression::getImplicitSelfDeclForSuperContext(SourceLoc Loc) {
1667
1663
return methodSelf;
1668
1664
}
1669
1665
1670
- // / Check if this is a postfix '...' operator, which might denote a pack
1671
- // / expansion expression.
1672
- Expr *PreCheckExpression::isPostfixEllipsisOperator (Expr *E) {
1673
- if (!Ctx.LangOpts .hasFeature (Feature::VariadicGenerics))
1674
- return nullptr ;
1675
-
1676
- auto *postfixExpr = dyn_cast<PostfixUnaryExpr>(E);
1677
- if (!postfixExpr)
1678
- return nullptr ;
1679
-
1680
- if (auto *op = dyn_cast<OverloadedDeclRefExpr>(postfixExpr->getFn ())) {
1681
- if (op->getDecls ()[0 ]->getBaseName ().getIdentifier ().isExpansionOperator ()) {
1682
- return postfixExpr->getOperand ();
1683
- }
1684
- } else if (auto *op = dyn_cast<UnresolvedDeclRefExpr>(postfixExpr->getFn ())) {
1685
- if (op->getName ().getBaseName ().getIdentifier ().isExpansionOperator ())
1686
- return postfixExpr->getOperand ();
1687
- }
1688
-
1689
- return nullptr ;
1690
- }
1691
-
1692
1666
// / Simplify expressions which are type sugar productions that got parsed
1693
1667
// / as expressions due to the parser not knowing which identifiers are
1694
1668
// / type names.
0 commit comments