Subject: | Metaroles can declare conflicting trait aliases |
package My::Trait1 {
use Moose::Role;
Moose::Util::meta_attribute_alias('MyTrait');
};
package My::Trait2 {
use Moose::Role;
Moose::Util::meta_attribute_alias('MyTrait');
};
package My::Class {
use Moose;
has a => (
is => 'ro',
traits => ['MyTrait'],
);
};
my $attr = My::Class->meta->get_attribute('a');
print "a does $_\n" for @{$attr->applied_traits};
-------
This action-at-a-distance, which often happens in packages that are quite far away from each other, can be quite confusing.
Can we get at least a warning when clobbering an alias?