Sha256: c86d4898c738e23654f501e6b77f2567c867d2047909ee69877d1de4984d9fd6
Contents?: true
Size: 1.07 KB
Versions: 33
Compression:
Stored size: 1.07 KB
Contents
package Moose::Exception::MetaclassTypeIncompatible; our $VERSION = '2.2207'; use Moose; extends 'Moose::Exception'; with 'Moose::Exception::Role::Class'; use Moose::Util 'find_meta'; has [qw(superclass_name metaclass_type)] => ( is => 'ro', isa => 'Str', required => 1 ); sub _build_message { my $self = shift; my $class_name = $self->class_name; my $superclass_name = $self->superclass_name; my $metaclass_type = $self->metaclass_type; my $metaclass_type_name = $metaclass_type; $metaclass_type_name =~ s/_(?:meta)?class$//; $metaclass_type_name =~ s/_/ /g; my $class = find_meta( $class_name ); my $self_metaclass_type = $class->$metaclass_type; my $super_meta = Class::MOP::get_metaclass_by_name($superclass_name); my $super_metatype = $super_meta->$metaclass_type; return "The $metaclass_type metaclass for $class_name" . " ($self_metaclass_type) is not compatible with the $metaclass_type_name" . " metaclass of its superclass, $superclass_name ($super_metatype)"; } __PACKAGE__->meta->make_immutable; 1;
Version data entries
33 entries across 21 versions & 1 rubygems