From: Yuval Kogman Date: Sun, 13 Jan 2008 23:26:41 +0000 (+0000) Subject: correct usage of compiled_type_constraint X-Git-Tag: 0_35~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5e02366bb36b4cfb4b82e8cfac5690841f1e435a;p=gitmo%2FMoose.git correct usage of compiled_type_constraint --- diff --git a/lib/Moose/Meta/Method/Accessor.pm b/lib/Moose/Meta/Method/Accessor.pm index daf68b5..80c821d 100644 --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@ -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; diff --git a/lib/Moose/Meta/Method/Constructor.pm b/lib/Moose/Meta/Method/Constructor.pm index 0c0e1f6..97f51ca 100644 --- a/lib/Moose/Meta/Method/Constructor.pm +++ b/lib/Moose/Meta/Method/Constructor.pm @@ -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;