@@ -394,6 +394,7 @@ ConcreteDeclRef Expr::getReferencedDecl(bool stopAtParenExpr) const {
394
394
395
395
NO_REFERENCE (VarargExpansion);
396
396
NO_REFERENCE (PackExpansion);
397
+ NO_REFERENCE (PackElement);
397
398
NO_REFERENCE (DynamicType);
398
399
399
400
PASS_THROUGH_REFERENCE (RebindSelfInConstructor, getSubExpr);
@@ -750,6 +751,7 @@ bool Expr::canAppendPostfixExpression(bool appendingPostfixOperator) const {
750
751
case ExprKind::MakeTemporarilyEscapable:
751
752
case ExprKind::VarargExpansion:
752
753
case ExprKind::PackExpansion:
754
+ case ExprKind::PackElement:
753
755
return false ;
754
756
755
757
case ExprKind::Call:
@@ -927,6 +929,7 @@ bool Expr::isValidParentOfTypeExpr(Expr *typeExpr) const {
927
929
case ExprKind::InOut:
928
930
case ExprKind::VarargExpansion:
929
931
case ExprKind::PackExpansion:
932
+ case ExprKind::PackElement:
930
933
case ExprKind::DynamicType:
931
934
case ExprKind::RebindSelfInConstructor:
932
935
case ExprKind::OpaqueValue:
@@ -1258,6 +1261,12 @@ PackExpansionExpr::create(ASTContext &ctx, Expr *patternExpr,
1258
1261
implicit, type);
1259
1262
}
1260
1263
1264
+ PackElementExpr *
1265
+ PackElementExpr::create (ASTContext &ctx, SourceLoc eachLoc, Expr *packRefExpr,
1266
+ bool implicit, Type type) {
1267
+ return new (ctx) PackElementExpr (eachLoc, packRefExpr, implicit, type);
1268
+ }
1269
+
1261
1270
SequenceExpr *SequenceExpr::create (ASTContext &ctx, ArrayRef<Expr*> elements) {
1262
1271
assert (elements.size () & 1 && " even number of elements in sequence" );
1263
1272
size_t bytes = totalSizeToAlloc<Expr *>(elements.size ());
0 commit comments