fix mistaken commit
Ricardo SIGNES [Wed, 21 Jan 2009 23:12:40 +0000 (23:12 +0000)]
lib/Moose/Util/TypeConstraints.pm

index 8aa7f3f..e71541c 100644 (file)
@@ -306,16 +306,16 @@ 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')
+      #  ->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;
+          }
+      )
     );
 }