X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;h=315eaa4591e046bab9727242944d12b881ffd472;hp=c1cb2fe36060e49ffc1640a1c2899d3c107a931d;hb=637d4f17e6965551c032a3115dcbbb4d8e01fbf5;hpb=7d2a0f10529e2effdb18d9f85a157700bf6236a7 diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index c1cb2fe..315eaa4 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -335,6 +335,12 @@ sub install_accessors{ $attribute->create($metaclass, $attribute->name, %{$attribute}); } + if(!$attribute->{associated_methods} && ($attribute->{is} || '') ne 'bare'){ + Carp::cluck( + 'Attribute (' . $attribute->name . ') of class ' . $metaclass->name + . ' has no associated methods (did you mean to provide an "is" argument?)'); + } + return; } @@ -372,10 +378,8 @@ sub _canonicalize_handles { sub _make_delegation_method { my($self, $handle, $method_to_call) = @_; - my $delegator = $self->delegation_metaclass; - Mouse::Util::load_class($delegator); - - return $delegator->_generate_delegation($self, $handle, $method_to_call); + return Mouse::Util::load_class($self->delegation_metaclass) + ->_generate_delegation($self, $handle, $method_to_call); } sub throw_error{ @@ -394,7 +398,7 @@ Mouse::Meta::Attribute - The Mouse attribute metaclass =head1 VERSION -This document describes Mouse version 0.50 +This document describes Mouse version 0.50_03 =head1 METHODS