X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FTypes%2FBase.pm;h=f5d32b79990199d72879ca18592f3dc6a484677a;hb=9563f55e99998c6618453988ccba898bc5613192;hp=63d9cee0823f018967eb56330ac0ef46063c1e07;hpb=b3b39119eb1289028d1e0536ad15a594ba54db60;p=gitmo%2FMooseX-Types.git diff --git a/lib/MooseX/Types/Base.pm b/lib/MooseX/Types/Base.pm index 63d9cee..f5d32b7 100644 --- a/lib/MooseX/Types/Base.pm +++ b/lib/MooseX/Types/Base.pm @@ -10,7 +10,7 @@ MooseX::Types::Base - Type library base class #use strict; use Sub::Install qw( install_sub ); -use Carp qw( croak ); +use Carp::Clan qw( ^MooseX::Types ); use MooseX::Types::Util qw( filter_tags ); use Moose::Util::TypeConstraints; use Moose; @@ -75,7 +75,8 @@ sub export_type_into { my ($class, $target, $type, $undef_msg, %args) = @_; # the real type name and its type object - my $full = $class->get_type($type); + my $full = $class->get_type($type) + or croak "No fully qualified type name stored for '$type'"; my $tobj = find_type_constraint($full); # a possible wrapper around library functionality @@ -97,7 +98,7 @@ sub export_type_into { # only install to_Type coercion handler if type can coerce # or if we want to provide them anyway, e.g. declarations - if ($args{ -full } or $tobj->has_coercion) { + if ($args{ -full } or $tobj and $tobj->has_coercion) { # install to_Type coercion handler install_sub({