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=a761d14542a3099d5df8a16f475c19d96fd330f1;hp=c0c425e98ba32cf97882643131075ffae981b717;hb=ac3bb63341584a1de80eb26340d9b877624c1834;hpb=506fb74dbff3e8f756230c643d8bff7b85ae9ca3 diff --git a/lib/Mouse/Meta/TypeConstraint.pm b/lib/Mouse/Meta/TypeConstraint.pm index c0c425e..a761d14 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.40_09 +This document describes Mouse version 0.4501 =head1 DESCRIPTION