Permalink
Browse files

required params need to come before optional ones (RT #71110)

  • Loading branch information...
1 parent e2cbb6d commit 398be5af233abebcca58214955a4224d47ed447d @moritz moritz committed Sep 30, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 S06-signature/optional.t
View
6 S06-signature/optional.t
@@ -3,7 +3,7 @@ use Test;
# L<S06/Optional parameters/>
-plan 20;
+plan 21;
sub opt1($p?) { defined($p) ?? $p !! 'undef'; }
@@ -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.