X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FTypeConstraint.pm;h=34afeab261fd51db9558218e4f0350b66ebc170b;hp=8d2b19b7714de5d54ad9dc5e8e415c18a9bca1f0;hb=47c73874c0f53fc133dc692896877b9e936ecae8;hpb=a4cbb3cb944aa43521dfa69a9f04b206c6b7a6ea diff --git a/lib/Mouse/Meta/TypeConstraint.pm b/lib/Mouse/Meta/TypeConstraint.pm index 8d2b19b..34afeab 100644 --- a/lib/Mouse/Meta/TypeConstraint.pm +++ b/lib/Mouse/Meta/TypeConstraint.pm @@ -24,13 +24,6 @@ sub new { my $check = delete $args{optimized}; - if($args{_compiled_type_constraint}){ - Carp::cluck("'_compiled_type_constraint' has been deprecated, use 'optimized' instead") - if Mouse::Util::_MOUSE_VERBOSE; - - $check = $args{_compiled_type_constraint}; - } - if($check){ $args{hand_optimized_type_constraint} = $check; $args{compiled_type_constraint} = $check; @@ -114,15 +107,15 @@ sub _add_type_coercions{ } else{ $self->{_compiled_type_coercion} = sub { - my($thing) = @_; - foreach my $pair (@{$coercions}) { - #my ($constraint, $converter) = @$pair; - if ($pair->[0]->check($thing)) { + my($thing) = @_; + foreach my $pair (@{$coercions}) { + #my ($constraint, $converter) = @$pair; + if ($pair->[0]->check($thing)) { local $_ = $thing; return $pair->[1]->($thing); - } - } - return $thing; + } + } + return $thing; }; } return; @@ -210,7 +203,7 @@ Mouse::Meta::TypeConstraint - The Mouse Type Constraint metaclass =head1 VERSION -This document describes Mouse version 0.44 +This document describes Mouse version 0.49 =head1 DESCRIPTION