line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Exception::MetaclassIsARoleNotASubclassOfGivenMetaclass; |
2
|
|
|
|
|
|
|
our $VERSION = '2.2203'; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
589
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
extends 'Moose::Exception'; |
6
|
|
|
|
|
|
|
with 'Moose::Exception::Role::Role'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
11
|
use Moose::Util 'find_meta'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'metaclass' => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
isa => 'Str', |
13
|
|
|
|
|
|
|
required => 1 |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _build_message { |
17
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
18
|
1
|
|
|
|
|
53
|
my $role_name = $self->role_name; |
19
|
1
|
|
|
|
|
5
|
my $role = find_meta( $role_name ); |
20
|
1
|
|
|
|
|
41
|
my $metaclass = $self->metaclass; |
21
|
1
|
|
|
|
|
30
|
return "$role_name already has a metaclass, but it does not inherit $metaclass ($role). " |
22
|
|
|
|
|
|
|
."You cannot make the same thing a role and a class. Remove either Moose or Moose::Role."; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
26
|
|
|
|
|
|
|
1; |