Skip to content

Commit

Permalink
Merge pull request #25 from haarg/dict-tuple-warn
Browse files Browse the repository at this point in the history
avoid warnings in Dict and Tuple types
  • Loading branch information
tobyink committed May 7, 2015
2 parents 4c980f8 + 249efe3 commit 7a4c5f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Types/Standard/Dict.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion lib/Types/Standard/Tuple.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
Expand Down

0 comments on commit 7a4c5f6

Please sign in to comment.