From: Stevan Little Date: Sat, 28 Apr 2007 02:12:26 +0000 (+0000) Subject: foo X-Git-Tag: 0_21~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5cb193ed690e881afdc9f84c1109b19c1e615a05;p=gitmo%2FMoose.git foo --- diff --git a/Changes b/Changes index 684666f..ecd9f7e 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,11 @@ Revision history for Perl extension Moose - fixed issue where custom attribute metaclasses where not handled correctly in roles - added tests for this + + * Moose::Meta::Class + - fixed issue where extending metaclasses with + roles would blow up. Thanks to Aankhen`` for + finding this insidious error, and it's solution. ~~ many spelling fixes in the docs ~~ ~~ thanks to rlb3 for this !! ~~ diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 3354d07..66a2110 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -9,7 +9,7 @@ use Class::MOP; use Carp 'confess'; use Scalar::Util 'weaken', 'blessed', 'reftype'; -our $VERSION = '0.12'; +our $VERSION = '0.13'; our $AUTHORITY = 'cpan:STEVAN'; use Moose::Meta::Method::Overriden; @@ -63,6 +63,12 @@ sub excludes_role { || confess "You must supply a role name to look for"; foreach my $class ($self->class_precedence_list) { next unless $class->can('meta'); + # NOTE: + # in the pretty rare instance when a Moose metaclass + # is itself extended with a role, this check needs to + # be done since some items in the class_precedence_list + # might in fact be Class::MOP based still. + next unless $class->meta->can('roles'); foreach my $role (@{$class->meta->roles}) { return 1 if $role->excludes_role($role_name); }