Skip to content

Commit

Permalink
Merge pull request #1108 from LLFourn/export-constant-regex
Browse files Browse the repository at this point in the history
Fix 'is export' on constants assigned to routines
  • Loading branch information
zoffixznet committed Jul 6, 2017
2 parents 15a9338 + d067abf commit 488abd8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/traits.pm
Expand Up @@ -251,13 +251,12 @@ my $!;
my $/;
my $_;

multi sub trait_mod:<is>(Routine:D \r, :$export!) {
multi sub trait_mod:<is>(Routine:D \r, :$export!, :$SYMBOL = '&' ~ r.name) {
my $to_export := r.multi ?? r.dispatcher !! r;
my $exp_name := '&' ~ r.name;
my @tags = flat 'ALL', (nqp::istype($export,Pair) ?? $export.key() !!
nqp::istype($export,Positional) ?? @($export)>>.key !!
'DEFAULT');
Rakudo::Internals.EXPORT_SYMBOL($exp_name, @tags, $to_export);
Rakudo::Internals.EXPORT_SYMBOL(nqp::decont($SYMBOL), @tags, $to_export);
}
multi sub trait_mod:<is>(Mu:U \type, :$export!) {
my $exp_name := type.^shortname;
Expand Down

0 comments on commit 488abd8

Please sign in to comment.