X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;h=eb3613f539207b07e053f1a2822c579167a7e1a1;hb=4aaed9e5cc435a2085e46f4c98a3abc233ecacaf;hp=cc43a3711fe3a3f38f5cb050f0b90c0a4b896603;hpb=d990f7911dfd6a36d1dcc072e7adb72bf0379349;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index cc43a37..eb3613f 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; } @@ -375,10 +381,7 @@ sub _make_delegation_method { my $delegator = $self->delegation_metaclass; Mouse::Util::load_class($delegator); - return $delegator->_generate_delegation($self, $handle, - ref($method_to_call) eq 'ARRAY' - ? @{$method_to_call} - : $method_to_call); + return $delegator->_generate_delegation($self, $handle, $method_to_call); } sub throw_error{