Checking in changes prior to tagging of version 0.88.
[gitmo/Mouse.git] / lib / Mouse / Meta / Attribute.pm
index 736c814..143714b 100644 (file)
@@ -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