From: Graham Knop Date: Thu, 11 Jul 2013 08:10:50 +0000 (-0400) Subject: Stop using Role::Tiny's backcompat hack X-Git-Tag: v1.003000~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e92de3765df279d097d5cd5330e85a7faadcdc7b;p=gitmo%2FMoo.git Stop using Role::Tiny's backcompat hack --- diff --git a/Makefile.PL b/Makefile.PL index 631ce86..63c2790 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -21,7 +21,7 @@ my %RUN_DEPS = ( 'Class::Method::Modifiers' => 1.10, 'strictures' => 1.004003, 'Module::Runtime' => 0.012, - 'Role::Tiny' => 1.002004, + 'Role::Tiny' => 1.003000, 'Devel::GlobalDestruction' => 0.11, 'Dist::CheckConflicts' => 0.02, ); diff --git a/lib/Moo/Role.pm b/lib/Moo/Role.pm index c890dfe..401cfdc 100644 --- a/lib/Moo/Role.pm +++ b/lib/Moo/Role.pm @@ -206,10 +206,16 @@ sub _make_accessors { } } +sub role_application_steps { + qw(_handle_constructor _maybe_make_accessors), + $_[0]->SUPER::role_application_steps; +} + sub apply_roles_to_package { my ($me, $to, @roles) = @_; foreach my $role (@roles) { - $me->_inhale_if_moose($role); + $me->_inhale_if_moose($role); + die "${role} is not a Moo::Role" unless $INFO{$role}; } $me->SUPER::apply_roles_to_package($to, @roles); } @@ -217,9 +223,7 @@ sub apply_roles_to_package { sub apply_single_role_to_package { my ($me, $to, $role) = @_; $me->_inhale_if_moose($role); - die "${role} is not a Moo::Role" unless my $info = $INFO{$role}; - $me->_handle_constructor($to, $role); - $me->_maybe_make_accessors($to, $role); + die "${role} is not a Moo::Role" unless $INFO{$role}; $me->SUPER::apply_single_role_to_package($to, $role); }