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=fb7047bf33f023c389a8981022aac16d3aa42e9d;hp=06d7749e30008b6324b02a05412085534bb1afe8;hb=278448b8f21fcab08c1e364e145b1848cca64c5c;hpb=267711f78bd79835875f805447d3ab802a18f0c4 diff --git a/lib/Mouse/Meta/TypeConstraint.pm b/lib/Mouse/Meta/TypeConstraint.pm index 06d7749..fb7047b 100644 --- a/lib/Mouse/Meta/TypeConstraint.pm +++ b/lib/Mouse/Meta/TypeConstraint.pm @@ -114,15 +114,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;