X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FAttribute.pm;h=143714be253e33eb79b280eda3c60066d12839a2;hb=66e3df7a8d3d839b53f6fc3af8f4bad6fc27fefe;hp=736c814f2e6458ea98cc0b2b2ac490181b14e294;hpb=b68e184f41984c03b19ac10b009dca1e9ed48ccb;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index 736c814..143714b 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -263,8 +263,9 @@ sub install_accessors{ # install delegation if(exists $attribute->{handles}){ my %handles = $attribute->_canonicalize_handles(); - while(my($handle, $method_to_call) = each %handles){ + next if Mouse::Object->can($handle); + if($metaclass->has_method($handle)) { $attribute->throw_error("You cannot overwrite a locally defined method ($handle) with a delegation"); } @@ -298,7 +299,7 @@ sub _canonicalize_handles { elsif ($handle_type eq 'Regexp') { my $meta = $self->_find_delegate_metaclass(); return map { $_ => $_ } - grep { !Mouse::Object->can($_) && $_ =~ $handles } + grep { /$handles/ } Mouse::Util::is_a_metarole($meta) ? $meta->get_method_list : $meta->get_all_method_names; @@ -341,7 +342,7 @@ Mouse::Meta::Attribute - The Mouse attribute metaclass =head1 VERSION -This document describes Mouse version 0.75 +This document describes Mouse version 0.88 =head1 DESCRIPTION