Use add_conflicted_method instead of add_required_methods where
Shawn M Moore [Sat, 30 May 2009 22:41:45 +0000 (18:41 -0400)]
appropriate

lib/Moose/Meta/Role/Application/RoleSummation.pm
lib/Moose/Meta/Role/Application/ToRole.pm

index e30bccb..f632c05 100644 (file)
@@ -169,7 +169,7 @@ sub apply_methods {
     foreach my $method (@all_methods) {
         if (exists $seen{$method->{name}}) {
             if ($seen{$method->{name}}->body != $method->{method}->body) {
-                $c->add_required_methods($method->{name});
+                $c->add_conflicted_method(name => $method->{name});
                 delete $method_map{$method->{name}};
                 next;
             }
index d0ecdb1..ed60669 100644 (file)
@@ -106,7 +106,10 @@ sub apply_methods {
             $role2->get_method($method_name)->body != $role1->get_method($method_name)->body) {
             # method conflicts between roles result
             # in the method becoming a requirement
-            $role2->add_required_methods($method_name);
+            $role2->add_conflicted_method(
+                name  => $method_name,
+                roles => [$role1->name, $role2->name],
+            );
         }
         else {
             # add it, although it could be overridden