@@ -3256,48 +3256,6 @@ class SequenceExpr final : public Expr,
3256
3256
};
3257
3257
3258
3258
3259
- // / Instances of this structure represent elements of the capture list that can
3260
- // / optionally occur in a capture expression.
3261
- struct CaptureListEntry {
3262
- VarDecl *Var;
3263
- PatternBindingDecl *Init;
3264
-
3265
- CaptureListEntry (VarDecl *Var, PatternBindingDecl *Init)
3266
- : Var(Var), Init(Init) {
3267
- }
3268
- };
3269
-
3270
- // / CaptureListExpr - This expression represents the capture list on an explicit
3271
- // / closure. Because the capture list is evaluated outside of the closure, this
3272
- // / CaptureList wraps the ClosureExpr. The dynamic semantics are that evaluates
3273
- // / the variable bindings from the capture list, then evaluates the
3274
- // / subexpression (the closure itself) and returns the result.
3275
- class CaptureListExpr : public Expr {
3276
- ArrayRef<CaptureListEntry> captureList;
3277
- Expr *closureBody;
3278
- public:
3279
- CaptureListExpr (ArrayRef<CaptureListEntry> captureList, Expr *closureBody)
3280
- : Expr(ExprKind::CaptureList, /* Implicit=*/ false , Type()),
3281
- captureList (captureList), closureBody(closureBody) {
3282
- }
3283
-
3284
- ArrayRef<CaptureListEntry> getCaptureList () { return captureList; }
3285
- Expr *getClosureBody () { return closureBody; }
3286
- const Expr *getClosureBody () const { return closureBody; }
3287
-
3288
- void setClosureBody (Expr *body) { closureBody = body; }
3289
-
3290
- // / This is a bit weird, but the capture list is lexically contained within
3291
- // / the closure, so the ClosureExpr has the full source range.
3292
- SWIFT_FORWARD_SOURCE_LOCS_TO (closureBody)
3293
-
3294
- // Implement isa/cast/dyncast/etc.
3295
- static bool classof(const Expr *E) {
3296
- return E->getKind () == ExprKind::CaptureList;
3297
- }
3298
- };
3299
-
3300
-
3301
3259
// / \brief A base class for closure expressions.
3302
3260
class AbstractClosureExpr : public Expr , public DeclContext {
3303
3261
CaptureInfo Captures;
@@ -3607,6 +3565,48 @@ class AutoClosureExpr : public AbstractClosureExpr {
3607
3565
}
3608
3566
};
3609
3567
3568
+ // / Instances of this structure represent elements of the capture list that can
3569
+ // / optionally occur in a capture expression.
3570
+ struct CaptureListEntry {
3571
+ VarDecl *Var;
3572
+ PatternBindingDecl *Init;
3573
+
3574
+ CaptureListEntry (VarDecl *Var, PatternBindingDecl *Init)
3575
+ : Var(Var), Init(Init) {
3576
+ }
3577
+ };
3578
+
3579
+ // / CaptureListExpr - This expression represents the capture list on an explicit
3580
+ // / closure. Because the capture list is evaluated outside of the closure, this
3581
+ // / CaptureList wraps the ClosureExpr. The dynamic semantics are that evaluates
3582
+ // / the variable bindings from the capture list, then evaluates the
3583
+ // / subexpression (the closure itself) and returns the result.
3584
+ class CaptureListExpr : public Expr {
3585
+ ArrayRef<CaptureListEntry> captureList;
3586
+ ClosureExpr *closureBody;
3587
+ public:
3588
+ CaptureListExpr (ArrayRef<CaptureListEntry> captureList,
3589
+ ClosureExpr *closureBody)
3590
+ : Expr(ExprKind::CaptureList, /* Implicit=*/ false , Type()),
3591
+ captureList (captureList), closureBody(closureBody) {
3592
+ }
3593
+
3594
+ ArrayRef<CaptureListEntry> getCaptureList () { return captureList; }
3595
+ ClosureExpr *getClosureBody () { return closureBody; }
3596
+ const ClosureExpr *getClosureBody () const { return closureBody; }
3597
+
3598
+ void setClosureBody (ClosureExpr *body) { closureBody = body; }
3599
+
3600
+ // / This is a bit weird, but the capture list is lexically contained within
3601
+ // / the closure, so the ClosureExpr has the full source range.
3602
+ SWIFT_FORWARD_SOURCE_LOCS_TO (closureBody)
3603
+
3604
+ // Implement isa/cast/dyncast/etc.
3605
+ static bool classof(const Expr *E) {
3606
+ return E->getKind () == ExprKind::CaptureList;
3607
+ }
3608
+ };
3609
+
3610
3610
// / DynamicTypeExpr - "type(of: base)" - Produces a metatype value.
3611
3611
// /
3612
3612
// / The metatype value comes from evaluating an expression then retrieving the
0 commit comments