From: Jesse Luehrs Date: Thu, 11 Nov 2010 22:13:04 +0000 (-0600) Subject: i think the changes i made to _method_map could make this work? X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=67c6080ef6bdb54744bbd5ce3a7696972b543a31;p=gitmo%2FClass-MOP.git i think the changes i made to _method_map could make this work? i don't know though, i don't know what was breaking previously --- diff --git a/lib/Class/MOP/Mixin/HasMethods.pm b/lib/Class/MOP/Mixin/HasMethods.pm index d3ceaa8..a593125 100644 --- a/lib/Class/MOP/Mixin/HasMethods.pm +++ b/lib/Class/MOP/Mixin/HasMethods.pm @@ -127,9 +127,10 @@ sub get_method { sub _get_maybe_raw_method { my ( $self, $method_name ) = @_; - my $method_map = $self->_method_map; - my $map_entry = $method_map->{$method_name}; - my $code = $self->get_package_symbol( + my $map_entry = $self->_method_map->{$method_name}; + return $map_entry if blessed $map_entry; + + my $code = $self->get_package_symbol( { name => $method_name, sigil => '&', @@ -137,13 +138,6 @@ sub _get_maybe_raw_method { } ); - # The !$code case seems to happen in some weird cases where methods - # modifiers are added via roles or some other such bizareness. Honestly, I - # don't totally understand this, but returning the entry works, and keeps - # various MX modules from blowing up. - DR - return $map_entry - if blessed $map_entry && ( !$code || $map_entry->body == $code ); - unless ($map_entry) { return unless $code && $self->_code_is_mine($code); }