From: Matt S Trout Date: Sat, 5 May 2012 17:51:40 +0000 (+0000) Subject: inhale Moose roles in apply_roles_to_package too X-Git-Tag: v0.091002~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4a79464d11f84dd87e33cda5e40e1fe0c2ca8049;p=gitmo%2FMoo.git inhale Moose roles in apply_roles_to_package too --- diff --git a/Changes b/Changes index 0055a6b..277b9dd 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,4 @@ + - inhale Moose roles before checking for composition conflicts - enable Moo::sification if only Moo::Role is loaded and not Moo - preserve attribute ordering - factor out accessor generation code a bit more to enable extension diff --git a/lib/Moo/Role.pm b/lib/Moo/Role.pm index 5624585..080ba92 100644 --- a/lib/Moo/Role.pm +++ b/lib/Moo/Role.pm @@ -94,6 +94,12 @@ sub _make_accessors { } } +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);