From: Shawn M Moore Date: Sat, 30 May 2009 22:41:45 +0000 (-0400) Subject: Use add_conflicted_method instead of add_required_methods where X-Git-Tag: 0.80~34 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=09798d40d2b565dd85135a8e458f6074f4228575;p=gitmo%2FMoose.git Use add_conflicted_method instead of add_required_methods where appropriate --- diff --git a/lib/Moose/Meta/Role/Application/RoleSummation.pm b/lib/Moose/Meta/Role/Application/RoleSummation.pm index e30bccb..f632c05 100644 --- a/lib/Moose/Meta/Role/Application/RoleSummation.pm +++ b/lib/Moose/Meta/Role/Application/RoleSummation.pm @@ -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; } diff --git a/lib/Moose/Meta/Role/Application/ToRole.pm b/lib/Moose/Meta/Role/Application/ToRole.pm index d0ecdb1..ed60669 100644 --- a/lib/Moose/Meta/Role/Application/ToRole.pm +++ b/lib/Moose/Meta/Role/Application/ToRole.pm @@ -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