correct usage of compiled_type_constraint
Yuval Kogman [Sun, 13 Jan 2008 23:26:41 +0000 (23:26 +0000)]
lib/Moose/Meta/Method/Accessor.pm
lib/Moose/Meta/Method/Constructor.pm

index daf68b5..80c821d 100644 (file)
@@ -25,11 +25,7 @@ sub _eval_code {
     my $type_constraint_obj  = $attr->type_constraint;
     my $type_constraint_name = $type_constraint_obj && $type_constraint_obj->name;
     my $type_constraint = $type_constraint_obj
-                                ? (
-                                    $type_constraint_obj->has_hand_optimized_type_constraint
-                                        ? $type_constraint_obj->hand_optimized_type_constraint
-                                        : $type_constraint_obj->_compiled_type_constraint
-                                    )
+                                ? $type_constraint_obj->_compiled_type_constraint
                                 : undef;
 
     my $sub = eval $code;
index 0c0e1f6..97f51ca 100644 (file)
@@ -89,7 +89,7 @@ sub intialize_body {
 
         my @type_constraints = map { $_->type_constraint } @$attrs;
         my @type_constraint_bodies = map {
-            $_ && ( $_->has_hand_optimized_type_constraint ? $_->hand_optimized_type_constraint : $_->_compiled_type_constraint );
+            $_ && $_->_compiled_type_constraint;
         } @type_constraints;
 
         $code = eval $source;