X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FUtil%2FTypeConstraints.pm;h=5b3130a6f9e8d13bfcf9f6f0712572d70d86f560;hb=cfa6d970245f1bbc9330c0e4bb3342356a43ac16;hp=9705b71ad516f240f0ed2b6dd61bd1ba6f3b91d7;hpb=e763d56e2b18480328a95cbbe9e9b58988a8c4dc;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Util/TypeConstraints.pm b/lib/Mouse/Util/TypeConstraints.pm index 9705b71..5b3130a 100644 --- a/lib/Mouse/Util/TypeConstraints.pm +++ b/lib/Mouse/Util/TypeConstraints.pm @@ -8,11 +8,8 @@ use Carp qw(confess); use Scalar::Util qw/blessed looks_like_number openhandle/; use Mouse::Util qw(does_role not_supported); -use Mouse::Meta::Module; # class_of use Mouse::Meta::TypeConstraint; -use constant _DEBUG => !!$ENV{TC_DEBUG}; - our @ISA = qw(Exporter); our @EXPORT = qw( as where message from via type subtype coerce class_type role_type enum @@ -223,7 +220,7 @@ sub _find_or_create_regular_type{ return $TYPE{$spec} if exists $TYPE{$spec}; - my $meta = Mouse::Meta::Module::class_of($spec); + my $meta = Mouse::Util::get_metaclass_by_name($spec); if(!$meta){ return; @@ -244,8 +241,6 @@ sub _find_or_create_regular_type{ $type = 'Class'; } - warn "#CREATE a $type type for $spec\n" if _DEBUG; - return $TYPE{$spec} = Mouse::Meta::TypeConstraint->new( name => $spec, optimized => $check, @@ -293,8 +288,6 @@ sub _find_or_create_parameterized_type{ my $name = sprintf '%s[%s]', $base->name, $param->name; $TYPE{$name} ||= do{ - warn "#CREATE a Parameterized type for $name\n" if _DEBUG; - my $generator = $base->{constraint_generator}; if(!$generator){ @@ -316,8 +309,6 @@ sub _find_or_create_union_type{ my $name = join '|', map{ $_->name } @types; $TYPE{$name} ||= do{ - warn "# CREATE a Union type for ", Mouse::Util::english_list(@types),"\n" if _DEBUG; - return Mouse::Meta::TypeConstraint->new( name => $name, type_constraints => \@types,