From: Graham Knop Date: Fri, 26 Apr 2013 19:26:23 +0000 (-0400) Subject: don't copy delegates into overridden attributes X-Git-Tag: v1.002000~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74e3858a6930de52cb908b8da542bcc0fccb97fd;p=gitmo%2FMoo.git don't copy delegates into overridden attributes --- diff --git a/lib/Method/Generate/Constructor.pm b/lib/Method/Generate/Constructor.pm index b696346..165df9c 100644 --- a/lib/Method/Generate/Constructor.pm +++ b/lib/Method/Generate/Constructor.pm @@ -16,9 +16,13 @@ sub register_attribute_specs { foreach my $key (keys %$old_spec) { if (!exists $new_spec->{$key}) { $new_spec->{$key} = $old_spec->{$key} + unless $key eq 'handles'; } elsif ($key eq 'moosify') { - $new_spec->{$key} = [map { ref $_ eq 'ARRAY' ? @$_ : $_ } ($old_spec->{$key}, $new_spec->{$key})]; + $new_spec->{$key} = [ + map { ref $_ eq 'ARRAY' ? @$_ : $_ } + ($old_spec->{$key}, $new_spec->{$key}) + ]; } } }