From: Jason May Date: Sat, 7 Aug 2010 17:59:14 +0000 (-0400) Subject: check if the metaclass is loaded X-Git-Tag: 2.0103~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7741404d102fd492a2826e7bfd3d35dfc3d1d131;p=gitmo%2FMoose.git check if the metaclass is loaded --- diff --git a/lib/Moose.pm b/lib/Moose.pm index e090be4..f776e12 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -141,6 +141,9 @@ sub init_meta { my $metaclass = $args{metaclass} || 'Moose::Meta::Class'; my $meta_name = exists $args{meta_name} ? $args{meta_name} : 'meta'; + Moose->throw_error("The Metaclass $metaclass must be loaded. (Perhaps you forgot to 'use $metaclass'?)") + unless Class::MOP::is_class_loaded($metaclass); + Moose->throw_error("The Metaclass $metaclass must be a subclass of Moose::Meta::Class.") unless $metaclass->isa('Moose::Meta::Class');