Update Makefile.PL
[gitmo/Mouse.git] / lib / Mouse / Meta / TypeConstraint.pm
index c9afe63..caeb980 100644 (file)
@@ -20,8 +20,8 @@ sub new {
 
     my $check = $args{_compiled_type_constraint} || $args{constraint};
 
-    # FIXME
     if(blessed($check)){
+        Carp::cluck("'constraint' must be a CODE reference");
         $check = $check->{_compiled_type_constraint};
     }
 
@@ -37,7 +37,13 @@ sub new {
 
 sub create_child_type{
     my $self = shift;
-    return ref($self)->new(@_, parent => $self);
+    # XXX: FIXME
+    return ref($self)->new(
+        %{$self},                            # pass the inherit parent attributes
+        _compiled_type_constraint => undef,  # ... other than compiled type constraint
+        @_,                                  # ... and args
+        parent => $self                      # ... and the parent
+   );
 }
 
 sub name    { $_[0]->{name}    }