X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FRole%2FApplication%2FRoleSummation.pm;h=309a08dc0e34c6424bffe49bcc6cf97f1766987f;hb=e3d94ac0990080399851812a76928c893c3cd4fa;hp=f632c05f433745535e35bfa5cb66b781ca3cf065;hpb=09798d40d2b565dd85135a8e458f6074f4228575;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Role/Application/RoleSummation.pm b/lib/Moose/Meta/Role/Application/RoleSummation.pm index f632c05..309a08d 100644 --- a/lib/Moose/Meta/Role/Application/RoleSummation.pm +++ b/lib/Moose/Meta/Role/Application/RoleSummation.pm @@ -8,7 +8,7 @@ use Scalar::Util 'blessed'; use Moose::Meta::Role::Composite; -our $VERSION = '0.79'; +our $VERSION = '0.82'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -167,15 +167,21 @@ sub apply_methods { my (%seen, %method_map); foreach my $method (@all_methods) { - if (exists $seen{$method->{name}}) { - if ($seen{$method->{name}}->body != $method->{method}->body) { - $c->add_conflicted_method(name => $method->{name}); + my $seen = $seen{$method->{name}}; + + if ($seen) { + if ($seen->{method}->body != $method->{method}->body) { + $c->add_conflicting_method( + name => $method->{name}, + roles => [$method->{role}->name, $seen->{role}->name], + ); + delete $method_map{$method->{name}}; next; } } - $seen{$method->{name}} = $method->{method}; + $seen{$method->{name}} = $method; $method_map{$method->{name}} = $method->{method}; }