1 package Moose::Exception::MethodConflict;
3 extends 'Moose::Exception';
7 builder => '_build_message',
12 isa => 'Moose::Meta::Class',
18 isa => 'ArrayRef[RoleName]', # XXX we should have objects here
20 default => sub { shift->_first_method->roles },
28 isa => 'ArrayRef[Moose::Meta::Role::Method::Conflicting]',
31 methods => 'elements',
32 _first_method => [ get => 0 ],
39 my $class = $self->consumer;
40 my @conflicts = $self->methods;
41 my $conflict = $self->_first_method;
42 my $roles = $conflict->roles_as_english_list;
44 my @same_role_conflicts = grep { $_->roles_as_english_list eq $roles } @conflicts;
46 if (@same_role_conflicts == 1) {
47 return "Due to a method name conflict in roles "
51 . "' must be implemented or excluded by '"
57 = Moose::Util::english_list( map { q{'} . $_->name . q{'} } @same_role_conflicts );
59 return "Due to method name conflicts in roles "
63 . " must be implemented or excluded by '"