Navigation Menu

Skip to content
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

Null PMC access when referring to a lexical variable in a scope that has not been run yet in Rakudo #1930

Closed
p6rt opened this issue Jul 11, 2010 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 11, 2010

Migrated from rt.perl.org#76466 (status was 'resolved')

Searchable as RT76466$

@p6rt
Copy link
Author

p6rt commented Jul 11, 2010

From @masak

<masak> rakudo​: sub foo { my $y; our sub bar { say $y } }; bar
<p6eval> rakudo 7579f7​: ( no output )
<masak> this is problematic in my model. :/
<masak> and seemingly in Rakudo's, too :)
<masak> locally, Null PMC access.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Jul 18, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S04-declarations/my.t

commit cce068982cf58cf2f71673f12de5262528202010
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sun Jul 18 14​:32​:57 2010 +0000

  [t/spec] test for RT #​76466#
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;31752 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S04-declarations/my.t b/t/spec/S04-declarations/my.t
index 68b5bc0..c02ddac 100644
--- a/t/spec/S04-declarations/my.t
+++ b/t/spec/S04-declarations/my.t
@@ -232,9 +232,10 @@ my $z = 42;
     }
 }
 
-# used to be RT #76366
+# used to be RT #76366, #76466
 {
-    lives_ok { access_lexical_a() },
+    #?rakudo skip 'RT 76466'
+    nok access_lexical_a().defined,
         'can call our-sub that accesses a lexical before the block was run';
     {
         my $a = 42;

@p6rt
Copy link
Author

p6rt commented Jul 18, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 7, 2011

From @coke

On Sun Jul 11 07​:07​:52 2010, masak wrote​:

<masak> rakudo​: sub foo { my $y; our sub bar { say $y } }; bar
<p6eval> rakudo 7579f7​: ( no output )
<masak> this is problematic in my model. :/
<masak> and seemingly in Rakudo's, too :)
<masak> locally, Null PMC access.
* masak submits rakudobug

This no longer generates an NPA​:

13​:18 < [Coke]> rakudo​: sub foo { my $y; our sub bar { say $y } }; bar
13​:18 <+p6eval> rakudo 1c2c2d​: OUTPUT«Could not find sub &barâ�¤ in
block <anon>
  at /tmp/SRJiCVZA9p​:1â�¤ in <anon> at
/tmp/SRJiCVZA9p​:1â�¤Â»

But moritz thinks this is still incorrect behavior.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 10, 2011

From @masak

On Fri Oct 07 10​:24​:37 2011, coke wrote​:

On Sun Jul 11 07​:07​:52 2010, masak wrote​:

<masak> rakudo​: sub foo { my $y; our sub bar { say $y } }; bar
<p6eval> rakudo 7579f7​: ( no output )
<masak> this is problematic in my model. :/
<masak> and seemingly in Rakudo's, too :)
<masak> locally, Null PMC access.
* masak submits rakudobug

This no longer generates an NPA​:

13​:18 < [Coke]> rakudo​: sub foo { my $y; our sub bar { say $y } }; bar
13​:18 <+p6eval> rakudo 1c2c2d​: OUTPUT«Could not find sub &barâ�¤ in
block <anon>
at /tmp/SRJiCVZA9p​:1â�¤ in <anon> at
/tmp/SRJiCVZA9p​:1â�¤Â»

But moritz thinks this is still incorrect behavior.

For what it's worth, I don't think it's incorrect behavior. Perl 6
semantics *used* to find &bar in the above case, but no longer does.
(This is part of a general trend of Perl 6 leaning more and more heavily
on lexical scoping as a guiding principle.) I think the change happened
somewhere around the nqp-rx/Rakudo Star transition.

@p6rt
Copy link
Author

p6rt commented Nov 12, 2011

From @tadzik

This now fails at CHECK time​:

sub foo { my $y; our sub bar { say $y } }; bar
CHECK FAILED​:
Undefined routine '&bar' called (line 1)

Tests are present, can we close this one?

@p6rt
Copy link
Author

p6rt commented Nov 12, 2011

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 12, 2011
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant