Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Walk default defaults in the optimizer.
  • Loading branch information
jnthn committed Apr 4, 2014
1 parent 39e7a00 commit 4dd7814
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/NQP/Optimizer.nqp
Expand Up @@ -277,8 +277,14 @@ class NQP::Optimizer {
self.visit_children($var);
} else {
my int $top := nqp::elems(@!block_var_stack) - 1;
if $var.decl {
my $decl := $var.decl;
if $decl {
@!block_var_stack[$top].add_decl($var);
if $decl eq 'param' && $var.default -> $default {
my $stmts_def := QAST::Stmts.new( $default );
self.visit_children($stmts_def);
$var.default($stmts_def[0]);
}
}
else {
@!block_var_stack[$top].add_usage($var);
Expand Down

0 comments on commit 4dd7814

Please sign in to comment.