Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 2f2567fa9fa905b58dcf726500e24dfc02399992 1 parent a677cbb
@moritz moritz authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.