X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FRole%2FComposite.pm;h=9968cbc6f7ccf6708924c2c55b27f7ef62331074;hb=refs%2Ftags%2F0.50_01;hp=771520b986467f4d8650146ddbf83539538e72d9;hpb=5af36247683101e3c457450489486d41f0bd7101;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Role/Composite.pm b/lib/Mouse/Meta/Role/Composite.pm index 771520b..9968cbc 100644 --- a/lib/Mouse/Meta/Role/Composite.pm +++ b/lib/Mouse/Meta/Role/Composite.pm @@ -84,21 +84,19 @@ sub _apply_methods{ if(exists $self->{conflicting_methods}){ my $consumer_class_name = $consumer->name; - my @conflicting = sort grep{ !$consumer_class_name->can($_) } keys %{ $self->{conflicting_methods} }; + my @conflicting = grep{ !$consumer_class_name->can($_) } keys %{ $self->{conflicting_methods} }; if(@conflicting == 1){ my $method_name = $conflicting[0]; - my @roles = sort @{ $self->{composed_roles_by_method}{$method_name} }; + my $roles = Mouse::Util::quoted_english_list(map{ $_->name } @{ $self->{composed_roles_by_method}{$method_name} }); $self->throw_error( sprintf q{Due to a method name conflict in roles %s, the method '%s' must be implemented or excluded by '%s'}, - Mouse::Util::quoted_english_list(map{ $_->name } @roles), $method_name, $consumer->name + $roles, $method_name, $consumer_class_name ); } elsif(@conflicting > 1){ - my $methods = Mouse::Util::quoted_english_list(@conflicting); - my %seen; - my $roles = Mouse::Util::quoted_english_list(sort + my $roles = Mouse::Util::quoted_english_list( grep{ !$seen{$_}++ } # uniq map { $_->name } map { @{$_} } @{ $self->{composed_roles_by_method} }{@conflicting} @@ -106,7 +104,9 @@ sub _apply_methods{ $self->throw_error( sprintf q{Due to method name conflicts in roles %s, the methods %s must be implemented or excluded by '%s'}, - $roles, $methods, $consumer->name + $roles, + Mouse::Util::quoted_english_list(@conflicting), + $consumer_class_name ); } } @@ -123,7 +123,7 @@ Mouse::Meta::Role::Composite - An object to represent the set of roles =head1 VERSION -This document describes Mouse version 0.49 +This document describes Mouse version 0.50_01 =head1 SEE ALSO