bump version to 0.65
[gitmo/Moose.git] / lib / Moose / Util / TypeConstraints.pm
index e71541c..5219091 100644 (file)
@@ -9,7 +9,7 @@ use List::MoreUtils qw( all );
 use Scalar::Util 'blessed';
 use Moose::Exporter;
 
-our $VERSION   = '0.64';
+our $VERSION   = '0.65';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -306,16 +306,7 @@ sub maybe_type {
     my ($type_parameter) = @_;
 
     register_type_constraint(
-      # $REGISTRY->get_type_constraint('Maybe')
-      #  ->generate_constraint_for($type_parameter)
-      Moose::Meta::TypeConstraint->new(
-          parent               => find_type_constraint('Item'),
-          constraint           => sub {
-              my $check = $type_parameter->_compiled_type_constraint;
-              return 1 if not(defined($_)) || $check->($_);
-              return;
-          }
-      )
+        $REGISTRY->get_type_constraint('Maybe')->parameterize($type_parameter)
     );
 }