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

Can't refer in a nested method to a variable residing in an outer method that hasn't been called in Rakudo #2363

Closed
p6rt opened this issue Feb 10, 2011 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 10, 2011

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

Searchable as RT83902$

@p6rt
Copy link
Author

p6rt commented Feb 10, 2011

From @masak

<masak> rakudo​: class A { method foo { my $a = 42; method bar { say $a
} } }; given A.new { .foo; .bar }
<p6eval> rakudo 86bf4c​: OUTPUT«42␤»
<masak> rakudo​: class A { method foo { my $a = 42; method bar { say $a
} } }; A.new.bar
<p6eval> rakudo 86bf4c​: OUTPUT«Null PMC access in type()␤ in 'A​::bar' [...]
* masak submits rakudobug
<masak> I suspected that might happen :P
<masak> at the point .bar is called, if .foo hasn't been called, $a
contains a Null PMC.
<masak> because the lexpad in .foo has never been visited, and thus is
not active.
<masak> this'll all be fixed when we have static lexpads.

@p6rt
Copy link
Author

p6rt commented Sep 30, 2011

From @moritz

Works now, and tested in t/spec/S12-methods/instance.t.

@p6rt
Copy link
Author

p6rt commented Sep 30, 2011

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

@p6rt p6rt closed this as completed Sep 30, 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