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=43a03c5f3a471e407dc8a92ba428e75c76fdf9b2;hp=cf81d078f6a9b7f49ea26defebec2c2a37354cd9;hb=4c99ea954f2e8db186c9b3559579f63d26969c95;hpb=4819ed36c693b311abb3f7d9965e1eeac1748345 diff --git a/lib/Mouse/Meta/TypeConstraint.pm b/lib/Mouse/Meta/TypeConstraint.pm index cf81d07..43a03c5 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; @@ -88,6 +81,15 @@ sub create_child_type{ ); } +sub name; +sub parent; +sub message; +sub has_coercion; +sub _compiled_type_constraint; +sub _compiled_type_coercion; + +sub compile_type_constraint; + sub _add_type_coercions{ my $self = shift; @@ -114,15 +116,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 +212,7 @@ Mouse::Meta::TypeConstraint - The Mouse Type Constraint metaclass =head1 VERSION -This document describes Mouse version 0.43 +This document describes Mouse version 0.49 =head1 DESCRIPTION