Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test for RT #76728, assigning to optional hash param
  • Loading branch information
moritz committed Oct 20, 2011
1 parent e42a6ad commit b653885
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S06-signature/optional.t
Expand Up @@ -3,7 +3,7 @@ use Test;

# L<S06/Optional parameters/>

plan 23;
plan 24;

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

Expand Down Expand Up @@ -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.