From: Matt S Trout Date: Sat, 5 May 2012 18:13:15 +0000 (+0000) Subject: exclude self from add_role X-Git-Tag: v0.091002~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd04120b3077f2d42abf965406ed0cae9ab7f180;p=gitmo%2FMoo.git exclude self from add_role --- diff --git a/lib/Moo/HandleMoose.pm b/lib/Moo/HandleMoose.pm index e63e0be..6540ec2 100644 --- a/lib/Moo/HandleMoose.pm +++ b/lib/Moo/HandleMoose.pm @@ -113,7 +113,8 @@ sub inject_real_metaclass_for { ); } $meta->add_role(Class::MOP::class_of($_)) - for do { no warnings 'once'; keys %{$Role::Tiny::APPLIED_TO{$name}} }; + for grep $_ ne $name, + do { no warnings 'once'; keys %{$Role::Tiny::APPLIED_TO{$name}} }; $DID_INJECT{$name} = 1; $meta; }