From: Shawn M Moore Date: Sat, 30 May 2009 22:05:12 +0000 (-0400) Subject: Use required_method objects, not names, in ToRole X-Git-Tag: 0.80~38 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c93bc92c088d7ae95e3ab597a4a01b133de763f;p=gitmo%2FMoose.git Use required_method objects, not names, in ToRole --- diff --git a/lib/Moose/Meta/Role/Application/ToRole.pm b/lib/Moose/Meta/Role/Application/ToRole.pm index cd08d1c..d0ecdb1 100644 --- a/lib/Moose/Meta/Role/Application/ToRole.pm +++ b/lib/Moose/Meta/Role/Application/ToRole.pm @@ -35,11 +35,12 @@ sub check_role_exclusions { sub check_required_methods { my ($self, $role1, $role2) = @_; - foreach my $required_method_name ($role1->get_required_method_list) { + foreach my $required_method ($role1->get_required_method_list) { + my $required_method_name = $required_method->name; next if $self->is_aliased_method($required_method_name); - $role2->add_required_methods($required_method_name) + $role2->add_required_methods($required_method) unless $role2->find_method_by_name($required_method_name); } }