Skip to content

Commit

Permalink
Tweaks on RakuAST::Type::Subset
Browse files Browse the repository at this point in the history
1. make :$name parameter mandatory
2. lose setting the default scope, would interfere with deparsing
  • Loading branch information
lizmat committed Feb 12, 2023
1 parent 28771d7 commit 30b398b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Raku/ast/type.rakumod
Expand Up @@ -325,11 +325,11 @@ class RakuAST::Type::Subset
has RakuAST::Declaration $.of;
has RakuAST::Package $!current-package;

method new(RakuAST::Name :$name, RakuAST::Expression :$where, List :$traits, str :$scope) {
method new(RakuAST::Name :$name!, RakuAST::Expression :$where, List :$traits, str :$scope) {
my $obj := nqp::create(self);
nqp::bindattr($obj, RakuAST::Type::Subset, '$!name', $name);
nqp::bindattr($obj, RakuAST::Type::Subset, '$!where', $where);
nqp::bindattr_s($obj, RakuAST::Declaration, '$!scope', $scope || $obj.default-scope);
nqp::bindattr_s($obj, RakuAST::Declaration, '$!scope', $scope);
for $obj.IMPL-UNWRAP-LIST($traits) {
$obj.add-trait($_.ast);
}
Expand Down

0 comments on commit 30b398b

Please sign in to comment.