From: Dave Rolsky Date: Sat, 26 Dec 2009 19:11:10 +0000 (-0600) Subject: only require that attributes implement CMOP::Mixin::AttributeBase to add them to... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=41d62121a64393345bbdddb71a461521db397132;p=gitmo%2FClass-MOP.git only require that attributes implement CMOP::Mixin::AttributeBase to add them to a thing which has attrs --- diff --git a/lib/Class/MOP/Mixin/HasAttributes.pm b/lib/Class/MOP/Mixin/HasAttributes.pm index 55d42ec..7103fa8 100644 --- a/lib/Class/MOP/Mixin/HasAttributes.pm +++ b/lib/Class/MOP/Mixin/HasAttributes.pm @@ -17,9 +17,9 @@ sub add_attribute { my $attribute = blessed( $_[0] ) ? $_[0] : $self->attribute_metaclass->new(@_); - ( $attribute->isa('Class::MOP::Attribute') ) + ( $attribute->isa('Class::MOP::Mixin::AttributeBase') ) || confess - "Your attribute must be an instance of Class::MOP::Attribute (or a subclass)"; + "Your attribute must be an instance of Class::MOP::Mixin::AttributeBase (or a subclass)"; $self->_attach_attribute($attribute);