From: Dave Rolsky <autarch@urth.org>
Date: Fri, 6 Jan 2012 21:00:24 +0000 (-0600)
Subject: During role summation, make sure that any method name that conflicts does not get... 
X-Git-Tag: 2.0500~107
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a76ce9523b714e6027ee1b4ed5e5694c1bb62b19;p=gitmo%2FMoose.git

During role summation, make sure that any method name that conflicts does not get added to the composite as a regular method.
---

diff --git a/lib/Moose/Meta/Role/Application/RoleSummation.pm b/lib/Moose/Meta/Role/Application/RoleSummation.pm
index cdedb94..c88fbd6 100644
--- a/lib/Moose/Meta/Role/Application/RoleSummation.pm
+++ b/lib/Moose/Meta/Role/Application/RoleSummation.pm
@@ -174,8 +174,9 @@ sub apply_methods {
         );
     } @{$c->get_roles};
 
-    my (%seen, %method_map);
+    my (%seen, %conflicts, %method_map);
     foreach my $method (@all_methods) {
+        next if $conflicts{$method->{name}};
         my $seen = $seen{$method->{name}};
 
         if ($seen) {
@@ -186,6 +187,7 @@ sub apply_methods {
                 );
 
                 delete $method_map{$method->{name}};
+                $conflicts{$method->{name}} = 1;
                 next;
             }
         }