init_arg can be undef
[gitmo/Moose.git] / lib / Moose / Meta / TypeCoercion.pm
index 36acba4..aaae013 100644 (file)
@@ -10,7 +10,7 @@ use Carp 'confess';
 use Moose::Meta::Attribute;
 use Moose::Util::TypeConstraints ();
 
-our $VERSION   = '0.05';
+our $VERSION   = '0.06';
 our $AUTHORITY = 'cpan:STEVAN';
 
 __PACKAGE__->meta->add_attribute('type_coercion_map' => (
@@ -55,7 +55,7 @@ sub compile_type_coercion {
         my $thing = shift;
         foreach my $coercion (@coercions) {
             my ($constraint, $converter) = @$coercion;
-            if (defined $constraint->($thing)) {
+            if ($constraint->($thing)) {
                 local $_ = $thing;                
                 return $converter->($thing);
             }
@@ -154,4 +154,4 @@ L<http://www.iinteractive.com>
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself. 
 
-=cut
\ No newline at end of file
+=cut