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&
334
334
entry.params = dispatcher.fetchRepeatedLabels (*decl.getParameters ());
335
335
auto self = const_cast <swift::ParamDecl* const >(decl.getImplicitSelfDecl ());
336
336
entry.self_param = dispatcher.fetchOptionalLabel (self);
337
+ entry.captures = dispatcher.fetchRepeatedLabels (decl.getCaptureInfo ().getCaptures ());
337
338
fillValueDecl (decl, entry);
338
339
fillGenericContext (decl, entry);
339
340
}
Original file line number Diff line number Diff line change @@ -8,3 +8,19 @@ func foo() {
8
8
print ( x)
9
9
print ( y) } ( )
10
10
}
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):
229
229
self_param : optional [ParamDecl ] | child
230
230
params : list [ParamDecl ] | child
231
231
body : optional ["BraceStmt" ] | child | desc ("The body is absent within protocol declarations." )
232
+ captures : list ["CapturedDecl" ] | child
232
233
233
234
class AbstractFunctionDecl (GenericContext , ValueDecl , Callable ):
234
235
pass
@@ -340,7 +341,7 @@ class Argument(Locatable):
340
341
expr : Expr | child
341
342
342
343
class AbstractClosureExpr (Expr , Callable ):
343
- captures : list [ "CapturedDecl" ] | child
344
+ pass
344
345
345
346
class AnyTryExpr (Expr ):
346
347
sub_expr : Expr | child
You can’t perform that action at this time.
0 commit comments