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=56d5cedfa0ab41d693d153ff1f18ea1d983a527b;hp=266e53d1d63a37f1d41f6332b63517c60ba062b3;hb=02bf7ed13ae5d43392767a38fe71e9606f1dba76;hpb=f7e41edaceee0d549a2d664378cfcf85dcf9454b diff --git a/lib/Mouse/Meta/TypeConstraint.pm b/lib/Mouse/Meta/TypeConstraint.pm index 266e53d..56d5ced 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_08 +This document describes Mouse version 0.48 =head1 DESCRIPTION