During role summation, make sure that any method name that conflicts does not get...
Dave Rolsky [Fri, 6 Jan 2012 21:00:24 +0000 (15:00 -0600)]
lib/Moose/Meta/Role/Application/RoleSummation.pm

index cdedb94..c88fbd6 100644 (file)
@@ -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;
             }
         }