}
}
else {
- my $role_meta = Class::MOP::load_class($handles);
+ Class::MOP::load_class($handles);
+ my $role_meta = Class::MOP::class_of($handles);
(blessed $role_meta && $role_meta->isa('Moose::Meta::Role'))
|| $self->throw_error("Unable to canonicalize the 'handles' option with $handles because its metaclass is not a Moose::Meta::Role", data => $handles);
my $self = shift;
my @supers = @_;
foreach my $super (@supers) {
- my $meta = Class::MOP::load_class($super);
+ Class::MOP::load_class($super);
+ my $meta = Class::MOP::class_of($super);
Moose->throw_error("You cannot inherit from a Moose Role ($super)")
if $meta && $meta->isa('Moose::Meta::Role')
}
my $roles = Data::OptList::mkopt( [@_] );
foreach my $role (@$roles) {
- my $meta = Class::MOP::load_class( $role->[0] );
+ Class::MOP::load_class( $role->[0] );
+ my $meta = Class::MOP::class_of( $role->[0] );
- unless ($meta->isa('Moose::Meta::Role') ) {
+ unless ($meta && $meta->isa('Moose::Meta::Role') ) {
require Moose;
Moose->throw_error( "You can only consume roles, "
. $role->[0]
ok($role->is_anon_role, "the role knows it's anonymous");
ok(Class::MOP::is_class_loaded(Moose::Meta::Role->create_anon_role->name), "creating an anonymous role satisifes is_class_loaded");
-ok(Class::MOP::load_class(Moose::Meta::Role->create_anon_role->name), "creating an anonymous role satisifes load_class");
+ok(Class::MOP::class_of(Moose::Meta::Role->create_anon_role->name), "creating an anonymous role satisifes class_of");