Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't make container if we immediately bind a var.
For example, in `my $a := 42;`, the container would be immediately
discarded, so don't bother allocating it at all.
  • Loading branch information
jnthn committed Apr 11, 2014
1 parent 319509a commit 806c867
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Perl6/Actions.nqp
Expand Up @@ -2095,6 +2095,9 @@ class Perl6::Actions is HLL::Actions does STDActions {
$past := make_dot_equals($past, $<initializer>.ast);
}
else {
if nqp::istype($past, QAST::Var) {
find_var_decl($*W.cur_lexpad(), $past.name).decl('var');
}
$past := bind_op($/, $past, $<initializer>.ast,
$<initializer><sym> eq '::=');
}
Expand Down

0 comments on commit 806c867

Please sign in to comment.