New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't access a lexical 'my' variable situated in an immediate block from an 'our'-scoped routine situated in the same block in Rakudo #1908
Comments
From @masak<masak> rakudo: { my $a; our sub foo() { $a } } |
From @jnthnOn Sat Jul 03 08:01:30 2010, masak wrote:
Now: 02:15 <@jnthn> rakudo: { my $a = 42; our sub foo() { $a } }; say foo() Given to moritz++ for spectesting. Thanks, Jonathan |
The RT System itself - Status changed from 'new' to 'open' |
@moritz - Status changed from 'open' to 'resolved' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/S04-declarations/my.t commit 250691a4b287c3ba06b94e5d107bd9e60cfcb20e [t/spec] tests for RT #76366, accessing lexicals through our-subs Inline Patchdiff --git a/t/spec/S04-declarations/my.t b/t/spec/S04-declarations/my.t
index b14c3c3..68b5bc0 100644
--- a/t/spec/S04-declarations/my.t
+++ b/t/spec/S04-declarations/my.t
@@ -1,7 +1,7 @@
use v6;
use Test;
-plan 63;
+plan 65;
#L<S04/The Relationship of Blocks and Declarations/"declarations, all
# lexically scoped declarations are visible">
@@ -232,6 +232,19 @@ my $z = 42;
}
}
+# used to be RT #76366
+{
+ lives_ok { access_lexical_a() },
+ 'can call our-sub that accesses a lexical before the block was run';
+ {
+ my $a = 42;
+ our sub access_lexical_a() { $a }
+ }
+ is access_lexical_a(), 42,
+ 'can call our-sub that accesses a lexical after the block was run';
+
+}
+
eval_lives_ok 'my (%h?)', 'my (%h?) lives';
#RT 63588 |
Migrated from rt.perl.org#76366 (status was 'resolved')
Searchable as RT76366$
The text was updated successfully, but these errors were encountered: