X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FClass.pm;h=1cd802152d47c554494b28c7e1ec03764953c2a6;hb=ed771761c8be1e83bc1cdd26c4f763dba5ba7cd2;hp=5f722f1490737ce04570b73d9fe0fa0a57ecaecf;hpb=e6ab9ca5a4c8fad570cf70bc6722d06e18542331;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 5f722f1..1cd8021 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -11,7 +11,7 @@ use List::Util qw( first ); use List::MoreUtils qw( any all uniq first_index ); use Scalar::Util 'weaken', 'blessed'; -our $VERSION = '0.83'; +our $VERSION = '0.84'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -243,11 +243,17 @@ sub superclasses { sub add_attribute { my $self = shift; - $self->SUPER::add_attribute( + my $attr = (blessed $_[0] && $_[0]->isa('Class::MOP::Attribute') ? $_[0] - : $self->_process_attribute(@_)) - ); + : $self->_process_attribute(@_)); + $self->SUPER::add_attribute($attr); + # it may be a Class::MOP::Attribute, theoretically, which doesn't have + # 'bare' and doesn't implement this method + if ($attr->can('_check_associated_methods')) { + $attr->_check_associated_methods; + } + return $attr; } sub add_override_method_modifier {