1package Moose::Exception::MetaclassIsAClassNotASubclassOfGivenMetaclass; 2our $VERSION = '2.2201'; 3 4use Moose; 5extends 'Moose::Exception'; 6with 'Moose::Exception::Role::Class'; 7 8use Moose::Util 'find_meta'; 9 10has 'metaclass' => ( 11 is => 'ro', 12 isa => 'Str', 13 required => 1 14); 15 16sub _build_message { 17 my $self = shift; 18 my $class = find_meta( $self->class_name ); 19 $self->class_name." already has a metaclass, but it does not inherit ".$self->metaclass. 20 " ($class). You cannot make the same thing a role and a class. Remove either Moose or Moose::Role."; 21} 22 23__PACKAGE__->meta->make_immutable; 241; 25