Skip to content

Commit

Permalink
RakuAST: RakuAST::Var::Package.new takes 2 nameds
Browse files Browse the repository at this point in the history
Thereby restoring the contract that RakuAST class .new only takes
named arguments if there is more than one possible argument.
  • Loading branch information
lizmat committed Feb 24, 2023
1 parent 1338f4a commit e73f3bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Raku/Actions.nqp
Expand Up @@ -1322,7 +1322,7 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
}
else { # package variable
self.attach: $/, self.r('Var', 'Package').new(
$longname<name>.ast,
:name($longname<name>.ast),
:$sigil
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Raku/ast/variable-access.rakumod
Expand Up @@ -431,7 +431,7 @@ class RakuAST::Var::Package
has str $.sigil;
has RakuAST::Name $.name;

method new(RakuAST::Name $name, :$sigil) {
method new(RakuAST::Name :$name!, :$sigil) {
my $obj := nqp::create(self);
nqp::bindattr($obj, RakuAST::Var::Package, '$!name', $name);
nqp::bindattr_s($obj, RakuAST::Var::Package, '$!sigil', $sigil);
Expand Down

0 comments on commit e73f3bb

Please sign in to comment.