Skip to content

Commit d3ad914

Browse files
committed
Add tests for R#2276
1 parent c60405b commit d3ad914

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

S02-names/is_dynamic.t

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 22;
4+
plan 28;
55

66
# not specifically typed
77
{
@@ -67,4 +67,28 @@ plan 22;
6767
ok %a<a>.VAR.dynamic, 'dynamic set correctly for reset Int %a<a>';
6868
} #4
6969

70+
# R#2276
71+
{
72+
sub visible($type) {
73+
is $*a, 42, "is \$*a$type visible";
74+
$*a = 666 if $type;
75+
}
76+
sub a($*a) {
77+
visible('')
78+
}
79+
sub b($*a is copy) {
80+
visible(' is copy');
81+
is $*a, 666, 'did the assignment work with is copy';
82+
}
83+
sub c($*a is rw) {
84+
visible(' is rw');
85+
is $*a, 666, 'did the assignment work with is rw';
86+
}
87+
88+
a(42);
89+
b(42);
90+
c(my $c = 42);
91+
is $c, 666, 'did the assignment work pass through with is rw';
92+
}
93+
7094
# vim: ft=perl6

0 commit comments

Comments
 (0)