X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod%2FDelegation.pm;h=9e6e3ef910c9243cc65342fe0cb4a053b9aafc99;hb=66e3df7a8d3d839b53f6fc3af8f4bad6fc27fefe;hp=851280ac1776ad219c14ac7d2ab1356c6407635b;hpb=98a8fd12ede46b22edc10d229680d9d2e8deeade;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method/Delegation.pm b/lib/Mouse/Meta/Method/Delegation.pm index 851280a..9e6e3ef 100644 --- a/lib/Mouse/Meta/Method/Delegation.pm +++ b/lib/Mouse/Meta/Method/Delegation.pm @@ -10,14 +10,14 @@ sub _generate_delegation{ ($method_to_call, @curried_args) = @{$method_to_call}; } - my $reader = $attr->get_read_method_ref(); + # If it has a reader, we must use it to make method modifiers work + my $reader = $attr->get_read_method() || $attr->get_read_method_ref(); - my $can_be_optimized = $attr->{_method_delegation_can_be_optimized}; + my $can_be_optimized = $attr->{_mouse_cache_method_delegation_can_be_optimized}; if(!defined $can_be_optimized){ - my $tc = $attr->type_constraint; - - $attr->{_method_delegation_can_be_optimized} = + my $tc = $attr->type_constraint; + $attr->{_mouse_cache_method_delegation_can_be_optimized} = (defined($tc) && $tc->is_a_type_of('Object')) && ($attr->is_required || $attr->has_default || $attr->has_builder) && ($attr->is_lazy || !$attr->has_clearer); @@ -61,7 +61,7 @@ Mouse::Meta::Method::Delegation - A Mouse method generator for delegation method =head1 VERSION -This document describes Mouse version 0.50_05 +This document describes Mouse version 0.88 =head1 SEE ALSO