X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod%2FDelegation.pm;h=3f9f009666eca721e283433644f64442c7291333;hb=145d67894adb93b4aa067e88b914fc83a5a3533c;hp=e18b58a74c372de11407846bafdfb69996859666;hpb=af4995e2c7e75d5eadf52aa9eff8214115174777;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method/Delegation.pm b/lib/Mouse/Meta/Method/Delegation.pm index e18b58a..3f9f009 100644 --- a/lib/Mouse/Meta/Method/Delegation.pm +++ b/lib/Mouse/Meta/Method/Delegation.pm @@ -10,12 +10,13 @@ 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}; if(!defined $can_be_optimized){ - my $tc = $attr->type_constraint; + my $tc = $attr->type_constraint; $attr->{_method_delegation_can_be_optimized} = (defined($tc) && $tc->is_a_type_of('Object')) @@ -61,7 +62,7 @@ Mouse::Meta::Method::Delegation - A Mouse method generator for delegation method =head1 VERSION -This document describes Mouse version 0.58 +This document describes Mouse version 0.74 =head1 SEE ALSO