When composing three roles, it is possible for the composite to end up with
both a conflict on a method and a method of that name. In most practical
applications, this doesn't really matter, since the conflict causes an
exception that must be resolved by the consumer.
However, it means that the composite reports bogus information when has_method
or get_method() is called.
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Fatal;
+
+use Moose::Util qw( find_meta );
+
+{
+ package RoleA;
+ use Moose::Role;
+
+ sub foo { 42 }
+}
+
+{
+ package RoleB;
+ use Moose::Role;
+
+ with 'RoleA';
+}
+
+{
+ package RoleC;
+ use Moose::Role;
+
+ sub foo { 84 }
+}
+
+{
+ my $composite
+ = Moose::Meta::Role->combine( map { [ find_meta($_) => {} ] }
+ qw( RoleA RoleB RoleC ) );
+ ok( $composite->requires_method('foo'), 'Composite of [ABC] requires a foo method' );
+ ok( ! $composite->has_method('foo'), 'Composite of [ABC] does not also have a foo method' );
+}
+
+{
+ my $composite
+ = Moose::Meta::Role->combine( map { [ find_meta($_) => {} ] }
+ qw( RoleA RoleC RoleB ) );
+ ok( $composite->requires_method('foo'), 'Composite of [ACB] requires a foo method' );
+ ok( ! $composite->has_method('foo'), 'Composite of [ACB] does not also have a foo method' );
+}
+
+done_testing;