Skip to content

Commit 1858f90

Browse files
committed
RT #76320, %$h coercion syntax
1 parent 2f0ccea commit 1858f90

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

S03-operators/context.t

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 29;
5+
plan 32;
66

77
# L<S03/List prefix precedence/The list contextualizer>
88

@@ -88,4 +88,22 @@ eval_dies_ok('@', 'Anonymous @ variable outside of declaration');
8888
eval_dies_ok('%', 'Anonymous % variable outside of declaration');
8989
eval_dies_ok('&', 'Anonymous & variable outside of declaration');
9090

91+
# RT #76320
92+
{
93+
my $h = <a b c d>;
94+
is ~%$h.keys.sort, 'a c', '%$var coercion';
95+
96+
my $c = 0;
97+
$c++ for @$h;
98+
is $c, 4, '@$var coercion';
99+
}
100+
101+
#?rakudo skip '$@var syntax'
102+
{
103+
my @a = <a b c d>;
104+
my $c = 0;
105+
$c++ for $@a;
106+
is $c, 1, '$@var itemization'
107+
}
108+
91109
# vim: ft=perl6

0 commit comments

Comments
 (0)