From: Shawn M Moore Date: Sun, 31 May 2009 02:03:34 +0000 (-0400) Subject: Include roles in the role summation add_conflicted_method X-Git-Tag: 0.80~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49b8c93a3b23e2f9d0d97f73b0fec3701fe15c6d;p=gitmo%2FMoose.git Include roles in the role summation add_conflicted_method --- diff --git a/lib/Moose/Meta/Role/Application/RoleSummation.pm b/lib/Moose/Meta/Role/Application/RoleSummation.pm index f632c05..74f9c54 100644 --- a/lib/Moose/Meta/Role/Application/RoleSummation.pm +++ b/lib/Moose/Meta/Role/Application/RoleSummation.pm @@ -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_conflicted_method( + name => $method->{name}, + roles => [$method->{role}, $seen->{role}], + ); + delete $method_map{$method->{name}}; next; } } - $seen{$method->{name}} = $method->{method}; + $seen{$method->{name}} = $method; $method_map{$method->{name}} = $method->{method}; }