Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct variable name in the documentation of Type::Params #37

Merged
merged 3 commits into from
Feb 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Type/Params.pm
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ example from the SYNOPSIS could be rewritten as:
sub deposit_monies
{
$deposit_monies_check ||= compile( Str, Str, slurpy ArrayRef[Num] );
my ($sort_code, $account_number, $monies) = $check->(@_);
my ($sort_code, $account_number, $monies) = $deposit_monies_check->(@_);

...;
}
Expand Down
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