Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Coerce default values.

  • Loading branch information...
commit 2f694500e1230ee653fc4643f1f6781d8655b6e6 1 parent df4e7c2
@rafl authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/MooseX/Method/Signatures/Meta/Method.pm
View
6 lib/MooseX/Method/Signatures/Meta/Method.pm
@@ -398,10 +398,10 @@ sub _build_type_constraint {
my $i = 0;
for my $param (@{ $positional }) {
- push @positional_args,
+ push @positional_args, map { $coerce_param->($param, $_) }
$#{ $_ } < $i
? (exists $param->{default} ? eval $param->{default} : ())
- : $coerce_param->($param, $_->[$i]);
+ : $_->[$i];
$i++;
}
@@ -414,7 +414,7 @@ sub _build_type_constraint {
}
if (exists $spec->{default}) {
- $named_args{$key} = eval $spec->{default};
+ $named_args{$key} = $coerce_param->($spec, eval $spec->{default});
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.