if (!$INFO{$role} and $INC{"Moose.pm"}) {
if (my $meta = Class::MOP::class_of($role)) {
$INFO{$role}{methods} = {
- map +($_ => $role->can($_)), $meta->get_method_list
+ map +($_ => $role->can($_)),
+ grep !$meta->get_method($_)->isa('Class::MOP::Method::Meta'),
+ $meta->get_method_list
};
$Role::Tiny::APPLIED_TO{$role} = {
map +($_->name => 1), $meta->calculate_all_roles
require Method::Generate::Accessor;
Method::Generate::Accessor->new
});
+ my $con_gen = $Moo::MAKERS{$target}{constructor};
my @attrs = @{$INFO{$role}{attributes}||[]};
while (my ($name, $spec) = splice @attrs, 0, 2) {
+ # needed to ensure we got an index for an arrayref based generator
+ if ($con_gen) {
+ $spec = $con_gen->all_attribute_specs->{$name};
+ }
$acc_gen->generate_method($target, $name, $spec);
}
}
+sub apply_roles_to_package {
+ my ($me, $to, @roles) = @_;
+ $me->_inhale_if_moose($_) for @roles;
+ $me->SUPER::apply_roles_to_package($to, @roles);
+}
+
sub apply_single_role_to_package {
my ($me, $to, $role) = @_;
$me->_inhale_if_moose($role);