Skip to content

Commit 71b2e9a

Browse files
committed
Fix sub installation/call to always have & before the sub name.
1 parent 72485de commit 71b2e9a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/NQP/Actions.pm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ class NQP::Actions is HLL::Actions {
810810
# Does the current block have a proto?
811811
if $*SCOPE eq 'our' { nqp::die('a multi can not be our-scoped') }
812812
my $proto;
813-
my %sym := $*W.cur_lexpad().symbol($name);
813+
my %sym := $*W.cur_lexpad().symbol('&' ~ $name);
814814
if %sym<proto> {
815815
$proto := %sym<value>;
816816
}
@@ -820,7 +820,7 @@ class NQP::Actions is HLL::Actions {
820820
# Check we have a proto in scope.
821821
my $found_proto;
822822
for $*W.get_legacy_block_list() {
823-
my %sym := $_.symbol($name);
823+
my %sym := $_.symbol('&' ~ $name);
824824
if %sym<proto> {
825825
$proto := %sym<value>;
826826
$found_proto := 1;
@@ -859,27 +859,27 @@ class NQP::Actions is HLL::Actions {
859859
my $BLOCK := $*W.cur_lexpad();
860860
$BLOCK[0].push(QAST::Op.new(
861861
:op('bind'),
862-
QAST::Var.new( :name($name), :scope('lexical'), :decl('var') ),
862+
QAST::Var.new( :name('&' ~ $name), :scope('lexical'), :decl('var') ),
863863
$past
864864
));
865-
$BLOCK.symbol($name, :scope('lexical'), :proto(1), :value($code) );
865+
$BLOCK.symbol('&' ~ $name, :scope('lexical'), :proto(1), :value($code) );
866866
}
867867
else {
868868
my $BLOCK := $*W.cur_lexpad();
869869
$BLOCK[0].push(QAST::Op.new(
870870
:op('bind'),
871-
QAST::Var.new( :name($name), :scope('lexical'), :decl('var') ),
871+
QAST::Var.new( :name('&' ~ $name), :scope('lexical'), :decl('var') ),
872872
$past
873873
));
874-
$BLOCK.symbol($name, :scope('lexical'));
874+
$BLOCK.symbol('&' ~ $name, :scope('lexical'));
875875
if $*SCOPE eq 'our' {
876876
# Need to install it at loadinit time but also re-bind
877877
# it per invocation.
878878
$*W.install_package_routine($*PACKAGE, $name, $past);
879879
$BLOCK[0].push(QAST::Op.new(
880880
:op('bind'),
881881
lexical_package_lookup([$name], $/),
882-
QAST::Var.new( :name($name), :scope('lexical') )
882+
QAST::Var.new( :name('&' ~ $name), :scope('lexical') )
883883
));
884884
}
885885
}
@@ -1206,7 +1206,7 @@ class NQP::Actions is HLL::Actions {
12061206

12071207
method term:sym<identifier>($/) {
12081208
my $past := $<args>.ast;
1209-
$past.name(~$<deflongname>);
1209+
$past.name('&' ~ ~$<deflongname>);
12101210
make $past;
12111211
}
12121212

0 commit comments

Comments
 (0)