Permalink
Browse files

test for RT #76728, assigning to optional hash param

  • Loading branch information...
1 parent e42a6ad commit b6538850f50abea082dfa25821f132f041b4c5d4 @moritz moritz committed Oct 20, 2011
Showing with 10 additions and 1 deletion.
  1. +10 −1 S06-signature/optional.t
@@ -3,7 +3,7 @@ use Test;
# L<S06/Optional parameters/>
-plan 23;
+plan 24;
sub opt1($p?) { defined($p) ?? $p !! 'undef'; }
@@ -94,4 +94,13 @@ eval_dies_ok 'sub opt($a = 1, $b) { }',
dies_ok { eval('opt-type2()') }, 'default values are type-checked';
}
+# RT # 76728
+{
+ sub opt-hash(%h?) {
+ %h<a> = 'b';
+ %h
+ }
+ is opt-hash().keys, 'a', 'can assign to optional parameter';
+}
+
# vim: ft=perl6

0 comments on commit b653885

Please sign in to comment.