Skip to content
Permalink
Browse files

Merge pull request #2964 from vrurg/rakudo_2955

Make `is export` export role's group
  • Loading branch information...
vrurg committed Jun 7, 2019
2 parents ee2f2d2 + 120b8d9 commit 163f0a0366b578d139550d916e526657e18db44d
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/core/traits.pm6
@@ -298,7 +298,9 @@ multi sub trait_mod:<is>(Mu:U \type, :$export!) {
~ "'$export.^name()' in trait 'is export'. Use a Pair "
~ 'or a list of Pairs, with keys as tag names.'
);
Rakudo::Internals.EXPORT_SYMBOL($exp_name, @tags, type);
# If a role is being exported export its respective group instead.
my \export_type := nqp::istype(type.HOW, Metamodel::ParametricRoleHOW) ?? type.^group !! type;
Rakudo::Internals.EXPORT_SYMBOL($exp_name, @tags, export_type);
if nqp::istype(type.HOW, Metamodel::EnumHOW) {
type.^set_export_callback( {
for type.^enum_values.keys -> $value_name {

0 comments on commit 163f0a0

Please sign in to comment.
You can’t perform that action at this time.