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}
$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
);
}
}