X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FRole%2FComposite.pm;h=101be9692cbfb78100ba603517578e531f55c698;hb=12f4a95a9552fd877d5efca81da5b60bc132d4c8;hp=5a53e531bf638d7489576fa3c3ac2b1728724d4a;hpb=806806614368604f49f5e27bf64d1b8d96241177;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Role/Composite.pm b/lib/Mouse/Meta/Role/Composite.pm index 5a53e53..101be96 100644 --- a/lib/Mouse/Meta/Role/Composite.pm +++ b/lib/Mouse/Meta/Role/Composite.pm @@ -16,16 +16,18 @@ sub add_method { return; } - if($method_name ne 'meta'){ + if($method_name eq 'meta'){ + $self->SUPER::add_method($method_name => $code); + } + else{ + # no need to add a subroutine to the stash my $roles = $self->{composed_roles_by_method}{$method_name} ||= []; push @{$roles}, $role; if(@{$roles} > 1){ $self->{conflicting_methods}{$method_name}++; } + $self->{methods}{$method_name} = $code; } - - $self->{methods}{$method_name} = $code; - # no need to add a subroutine to the stash return; } @@ -123,7 +125,7 @@ Mouse::Meta::Role::Composite - An object to represent the set of roles =head1 VERSION -This document describes Mouse version 0.50_07 +This document describes Mouse version 0.67 =head1 SEE ALSO