Permalink
Browse files

RT #79642, optional-but-not-bound hash is just a normal, empty Hash

  • Loading branch information...
1 parent a677cbb commit 2f2567fa9fa905b58dcf726500e24dfc02399992 @moritz moritz committed Apr 22, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 S06-signature/optional.t
View
8 S06-signature/optional.t
@@ -3,7 +3,7 @@ use Test;
# L<S06/Optional parameters/>
-plan 24;
+plan 25;
sub opt1($p?) { defined($p) ?? $p !! 'undef'; }
@@ -105,6 +105,12 @@ eval_dies_ok 'sub opt($a = 1, $b) { }',
%h
}
is opt-hash().keys, 'a', 'can assign to optional parameter';
+
+ # RT #79642
+ sub opt-hash2(%h?) {
+ %h;
+ }
+ ok opt-hash2() eqv ().hash, 'an optional-but-not-filled hash is just an empty Hash';
}
# vim: ft=perl6

0 comments on commit 2f2567f

Please sign in to comment.