Skip to content

Commit

Permalink
required params need to come before optional ones (RT #71110)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Sep 30, 2011
1 parent e2cbb6d commit 398be5a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions S06-signature/optional.t
Expand Up @@ -3,7 +3,7 @@ use Test;

# L<S06/Optional parameters/>

plan 20;
plan 21;

sub opt1($p?) { defined($p) ?? $p !! 'undef'; }

Expand Down Expand Up @@ -80,6 +80,8 @@ is opt_array2(), 0, "optional array not passed is empty (copy)";
is opt_hash1(), 0, "optional hash not passed is empty";
is opt_hash2(), 0, "optional hash not passed is empty (copy)";

done;
# RT #71110
eval_dies_ok 'sub opt($a = 1, $b) { }',
'Cannot put required parameter after optional parameters';

# vim: ft=perl6

0 comments on commit 398be5a

Please sign in to comment.