File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1487,6 +1487,7 @@ bool PreCheckExpression::exprLooksLikeAType(Expr *expr) {
1487
1487
isa<ParenExpr>(expr) ||
1488
1488
isa<ArrowExpr>(expr) ||
1489
1489
isa<PackExpansionExpr>(expr) ||
1490
+ isa<PackElementExpr>(expr) ||
1490
1491
isa<TupleExpr>(expr) ||
1491
1492
(isa<ArrayExpr>(expr) &&
1492
1493
cast<ArrayExpr>(expr)->getElements ().size () == 1 ) ||
@@ -1984,6 +1985,15 @@ TypeExpr *PreCheckExpression::simplifyTypeExpr(Expr *E) {
1984
1985
}
1985
1986
}
1986
1987
1988
+ // Fold a PackElementExpr into a TypeExpr when the element is a TypeExpr
1989
+ if (auto *element = dyn_cast<PackElementExpr>(E)) {
1990
+ if (auto *refExpr = dyn_cast<TypeExpr>(element->getPackRefExpr ())) {
1991
+ auto *repr = new (Ctx) PackReferenceTypeRepr (element->getStartLoc (),
1992
+ refExpr->getTypeRepr ());
1993
+ return new (Ctx) TypeExpr (repr);
1994
+ }
1995
+ }
1996
+
1987
1997
return nullptr ;
1988
1998
}
1989
1999
You can’t perform that action at this time.
0 commit comments