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