X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FRole%2FComposite.pm;h=c048f484e89ce46a83d3cfae024b6564d970ad6f;hb=913b59645bf5e7f16128c0e20711090a43676096;hp=0e64333c17901b402e2b65be7255f917eb007160;hpb=98a8fd12ede46b22edc10d229680d9d2e8deeade;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Role/Composite.pm b/lib/Mouse/Meta/Role/Composite.pm index 0e64333..c048f48 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_05 +This document describes Mouse version 0.61 =head1 SEE ALSO