From 249efe3bc8407ca7c6c0fc864ec437531ed08076 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 30 Apr 2015 16:25:49 -0400 Subject: [PATCH] avoid warnings in Dict and Tuple types --- lib/Types/Standard/Dict.pm | 2 +- lib/Types/Standard/Tuple.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Types/Standard/Dict.pm b/lib/Types/Standard/Dict.pm index 13d920afd..9bb6e65a2 100644 --- a/lib/Types/Standard/Dict.pm +++ b/lib/Types/Standard/Dict.pm @@ -226,7 +226,7 @@ sub __coercion_generator my $K = B::perlstring($k); push @code, sprintf( - 'if (exists $orig->{%s}) { $tmp = %s; (%s) ? ($new{%s}=$tmp) : ($return_orig=1 and last %s) }', + 'if (exists $orig->{%s}) { $tmp = %s; (%s) ? ($new{%s}=$tmp) : (($return_orig=1), last %s) }', $K, $ct_coerce ? $ct->coercion->inline_coercion("\$orig->{$K}") diff --git a/lib/Types/Standard/Tuple.pm b/lib/Types/Standard/Tuple.pm index 5dcc283c8..780dc5996 100644 --- a/lib/Types/Standard/Tuple.pm +++ b/lib/Types/Standard/Tuple.pm @@ -247,7 +247,7 @@ sub __coercion_generator my $ct_optional = $ct->is_a_type_of(Types::Standard::Optional); push @code, sprintf( - 'if (@$orig > %d) { $tmp = %s; (%s) ? ($new[%d]=$tmp) : ($return_orig=1 and last %s) }', + 'if (@$orig > %d) { $tmp = %s; (%s) ? ($new[%d]=$tmp) : (($return_orig=1), last %s) }', $i, $ct_coerce ? $ct->coercion->inline_coercion("\$orig->[$i]")