X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FUtil.pm;h=7ac2a08263001d537742448d1d4fa42f783003cb;hp=a2593cf2e4d758872a43f50452d322b3f55636d5;hb=745220df2da2256a9bd2692ac585f39b35ed19df;hpb=30518636145442894e3a55a06ef3a57db268c76d diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index a2593cf..7ac2a08 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -252,8 +252,7 @@ sub apply_all_roles { my $role_name = $roles[-1][0]; load_class($role_name); - my $metarole = get_metaclass_by_name($role_name); - ( $metarole && $metarole->isa('Mouse::Meta::Role') ) + Mouse::Util::TypeConstraints::_is_a_metarole( get_metaclass_by_name($role_name) ) || $applicant->meta->throw_error("You can only consume roles, $role_name(".$role_name->meta.") is not a Mouse role"); }