Skip to content

Commit c0c24ab

Browse files
committed
tests for RT #73344, where-constraint picked up the wrong outer lexical in rakudo
1 parent a1e114c commit c0c24ab

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

S02-types/subset.t

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use v6;
22
use Test;
3-
plan 42;
3+
plan 44;
44

55
=begin description
66
@@ -184,4 +184,17 @@ lives_ok { my Bug::RT80930 $rt80930 }, 'subset with "::" in the name';
184184

185185
}
186186

187+
# RT #73344
188+
my $a = 1;
189+
{
190+
my $a = 3;
191+
sub producer {
192+
my $a = 2;
193+
sub bar($x where $a ) { $x }
194+
}
195+
my &bar := producer();
196+
lives_ok { bar(2) }, 'where-constraint picks up the right lexical (+)';
197+
dies_ok { bar(1) }, 'where-constraint picks up the right lexical (-)';
198+
}
199+
187200
# vim: ft=perl6

0 commit comments

Comments
 (0)