0.03 ...
- Minor POD typo correction
+ - Added some error messages for wrong type names
+ - Coercion handler not exported without type object
0.02 Wed Aug 8 20:33:42 CEST 2007
- Changed declaration to croak when it sees '::' in a typename
#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;
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
# 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({