X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod%2FDelegation.pm;h=916c1fc833b39337e5ec4a92735840eb5c94195b;hb=1134f6943d6fefc9f72055de5552b2ed7ccbec45;hp=f8cad5ded37a1b9a6713e23818ab074d8a56ba22;hpb=aa36910f3b9f47855dcec65d906d79d4916c3074;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method/Delegation.pm b/lib/Mouse/Meta/Method/Delegation.pm index f8cad5d..916c1fc 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'))