* distinction on Moose::Meta::Class as per doy
if ( $meta = Class::MOP::get_metaclass_by_name($class) ) {
unless ( $meta->isa("Moose::Meta::Class") ) {
- Moose->throw_error("$class already has a metaclass, but it does not inherit $metaclass ($meta)");
+ my $error_message = "$class already has a metaclass, but it does not inherit $metaclass ($meta).";
+ if ( $meta->isa('Moose::Meta::Role') ) {
+ Moose->throw_error($error_message . ' You cannot make the same thing a role and a class. Remove either Moose or Moose::Role.');
+ } else {
+ Moose->throw_error($error_message);
+ }
}
} else {
# no metaclass, no 'meta' method