From: gfx Date: Tue, 27 Oct 2009 04:31:56 +0000 (+0900) Subject: Tweaks for compatibility X-Git-Tag: 0.40_02~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f41d79bbeee8ede7e5152d81ee315f6f581283e;p=gitmo%2FMouse.git Tweaks for compatibility --- diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index 5c87356..66c2e3c 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -267,7 +267,13 @@ sub clone_and_inherit_options{ my($attribute_class, @traits) = ref($self)->interpolate_class(\%args); $args{traits} = \@traits if @traits; - return $attribute_class->new($self->name, %{$self}, %args); + # do not inherit the 'handles' attribute + foreach my $name(keys %{$self}){ + if(!exists $args{$name} && $name ne 'handles'){ + $args{$name} = $self->{$name}; + } + } + return $attribute_class->new($self->name, %args); } sub clone_parent { # DEPRECATED