diff --git a/S04-declarations/my.t b/S04-declarations/my.t index 6984c8d475..5beca9c4af 100644 --- a/S04-declarations/my.t +++ b/S04-declarations/my.t @@ -1,7 +1,7 @@ use v6; use Test; -plan 96; +plan 97; #L @@ -162,6 +162,12 @@ is(EVAL('loop (my $x = 1, my $y = 2; $x > 0; $x--) { last }; $y #OK'), 2, '2nd m # RT #125371 throws-like 'my $z = $z', X::Syntax::Variable::Initializer, name => '$z'; +# RT #125371 +{ + my $py = 0 && try { my $py = 42; $py.bla() }; + is $py, 0, 'initializing a variable using a try block containing same name works'; +} + # interaction of my and EVAL # yes, it's weird... but that's the way it is # http://irclog.perlgeek.de/perl6/2009-03-19#i_1001177