Don't set package_defined_in automatically, because Moose doesn't do that.
gfx [Mon, 22 Feb 2010 06:14:44 +0000 (15:14 +0900)]
lib/Mouse/Meta/TypeConstraint.pm

index 6be61f6..5650c25 100644 (file)
@@ -35,8 +35,6 @@ sub new {
         Carp::confess("Constraint for $args{name} is not a CODE reference");
     }
 
-    $args{package_defined_in} ||= caller;
-
     my $self = bless \%args, $class;
     $self->compile_type_constraint() if !$self->{hand_optimized_type_constraint};