Skip to content

Commit

Permalink
[dotnet] Compile block references to either capture lexical context o…
Browse files Browse the repository at this point in the history
…r create a closure, based upon $block.closure.
  • Loading branch information
jnthn committed Oct 29, 2010
1 parent 1bb02e7 commit 13a72ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dotnet/compiler/PAST2DNSTCompiler.pm
Expand Up @@ -413,7 +413,12 @@ our multi sub dnst_for(PAST::Block $block) {
);
}
else {
return "StaticBlockInfo[$our_sbi]";
return DNST::MethodCall.new(
:on('Ops'), :name($block.closure ?? 'new_closure' !! 'capture_outer'),
:type('RakudoObject'),
'TC',
"StaticBlockInfo[$our_sbi]"
);
}
}

Expand Down

0 comments on commit 13a72ce

Please sign in to comment.