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=a66fb320c78a580186518ee1b7a61cdfb08d53e3;hp=eb3613f539207b07e053f1a2822c579167a7e1a1;hb=3b48bcc824fb6cfa90f907cf4d83e01c224a72dd;hpb=d503a4f3aa9eda772309f6c99ccd4dfcdfed059d diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index eb3613f..a66fb32 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -77,7 +77,9 @@ sub new { # (3) bad options found if(@bad){ @bad = sort @bad; - Carp::cluck("Found unknown argument(s) passed to '$name' attribute constructor in '$class': @bad"); + local $Carp::Internal{'Mouse'} = 1; + local $Carp::Internal{'Mouse::Meta::Class'} = 1; + Carp::carp("Found unknown argument(s) passed to '$name' attribute constructor in '$class': @bad"); } my $self = bless $args, $class; @@ -335,12 +337,6 @@ 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; } @@ -378,10 +374,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{ @@ -400,7 +394,7 @@ Mouse::Meta::Attribute - The Mouse attribute metaclass =head1 VERSION -This document describes Mouse version 0.50_02 +This document describes Mouse version 0.50_03 =head1 METHODS