File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,7 @@ void DeclTranslator::fillAbstractFunctionDecl(const swift::AbstractFunctionDecl&
334334 entry.params = dispatcher.fetchRepeatedLabels (*decl.getParameters ());
335335 auto self = const_cast <swift::ParamDecl* const >(decl.getImplicitSelfDecl ());
336336 entry.self_param = dispatcher.fetchOptionalLabel (self);
337+ entry.captures = dispatcher.fetchRepeatedLabels (decl.getCaptureInfo ().getCaptures ());
337338 fillValueDecl (decl, entry);
338339 fillGenericContext (decl, entry);
339340}
Original file line number Diff line number Diff line change @@ -8,3 +8,19 @@ func foo() {
88 print ( x)
99 print ( y) } ( )
1010}
11+
12+ var escape : ( ( ) -> ( ) ) ? = nil
13+
14+ func baz( ) {
15+ var x = 0
16+ func quux( ) {
17+ x += 1
18+ print ( x)
19+ }
20+ escape = quux
21+ }
22+
23+ func callEscape( ) {
24+ baz ( )
25+ escape ? ( )
26+ }
Original file line number Diff line number Diff line change @@ -229,6 +229,7 @@ class Callable(Element):
229229 self_param : optional [ParamDecl ] | child
230230 params : list [ParamDecl ] | child
231231 body : optional ["BraceStmt" ] | child | desc ("The body is absent within protocol declarations." )
232+ captures : list ["CapturedDecl" ] | child
232233
233234class AbstractFunctionDecl (GenericContext , ValueDecl , Callable ):
234235 pass
@@ -340,7 +341,7 @@ class Argument(Locatable):
340341 expr : Expr | child
341342
342343class AbstractClosureExpr (Expr , Callable ):
343- captures : list [ "CapturedDecl" ] | child
344+ pass
344345
345346class AnyTryExpr (Expr ):
346347 sub_expr : Expr | child
You can’t perform that action at this time.
0 commit comments