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

Parent attribute reference in BUILD gives LTA null PMC access message #2620

Closed
p6rt opened this issue Jan 25, 2012 · 6 comments
Closed

Parent attribute reference in BUILD gives LTA null PMC access message #2620

p6rt opened this issue Jan 25, 2012 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jan 25, 2012

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

Searchable as RT109064$

@p6rt
Copy link
Author

p6rt commented Jan 25, 2012

From @bbkr

bbkr
rakudo​: class A { has Int $.id; }; class B is A { submethod BUILD ( :$!id = 10 ) { } }; B.new

p6eval
rakudo 3670b7​: OUTPUT«Null PMC access in get_pmc_keyed_str()â�¤ in submethod BUILD at /tmp/NGnaIv23u2​:1â�¤ in method BUILDALL at src/gen/CORE.setting​:583â�¤ in method bless at src/gen/CORE.setting​:573â�¤ in method new at src/gen/CORE.setting​:558â�¤ in block <anon> at /tmp/NGnaIv23u2​:1â�¤ in <â�¦

bbkr
known bug? it only happens on inherited attributes.
another variation
rakudo​: class A { has Int $.id; }; class B is A { submethod BUILD ( $!id? ) { } }; B.new

p6eval
rakudo 3670b7​: OUTPUT«Null PMC access in get_pmc_keyed_str()â�¤ in submethod BUILD at /tmp/qLZGBlS5WY​:1â�¤ in method BUILDALL at src/gen/CORE.setting​:583â�¤ in method bless at src/gen/CORE.setting​:573â�¤ in method new at src/gen/CORE.setting​:558â�¤ in block <anon> at /tmp/qLZGBlS5WY​:1â�¤ in <â�¦
10​:54

jnthn
bbkr1​: That attribute ain't visible there.
Why it doesn't explode is a bit mysterious though...

masak
nom​: class A { has Int $.id; }; class B is A { submethod BUILD ( $!id ) { } }; B.new

p6eval
nom 3670b7​: OUTPUT«Not enough positional parameters passed; got 1 but expected 2â�¤ in submethod BUILD at /tmp/8FMWmEVmBd​:1â�¤ in method BUILDALL at src/gen/CORE.setting​:583â�¤ in method bless at src/gen/CORE.setting​:573â�¤ in method new at src/gen/CORE.setting​:558â�¤ in block <anon> at /tmpâ�¦

masak
aha!

jnthn
Of course, we can catch that one at compile time.

masak
yeah, but what about the error above?

jnthn
masak​: The error above is "right" though we should really catch the other one at compile time.
masak​: I mean, we'd not make it to runtime there.

TESTED ALSO ON LOCAL MACHINE

This is perl6 version 2012.01 built on parrot 3.11.0 revision RELEASE_3_11_0

@p6rt
Copy link
Author

p6rt commented Jan 25, 2012

From @bbkr

TEMP-25C0AG.png

@p6rt
Copy link
Author

p6rt commented Jan 25, 2012

From @jnthn

On Wed Jan 25 14​:02​:06 2012, pawel.pabian@​implix.com wrote​:

bbkr
rakudo​: class A { has Int $.id; }; class B is A { submethod BUILD (
:$!id = 10 ) { } }; B.new

p6eval
rakudo 3670b7​: OUTPUT«Null PMC access in get_pmc_keyed_str()â�¤ in
submethod BUILD at /tmp/NGnaIv23u2​:1â�¤ in method BUILDALL at
src/gen/CORE.setting​:583â�¤ in method bless at
src/gen/CORE.setting​:573â�¤ in method new at
src/gen/CORE.setting​:558â�¤ in block <anon> at /tmp/NGnaIv23u2​:1â�¤
in <�

This is now caught and reported at compile time. Giving for testing.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Jan 25, 2012

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

@p6rt
Copy link
Author

p6rt commented Nov 14, 2013

From @coke

On Wed Jan 25 14​:49​:07 2012, jnthn@​jnthn.net wrote​:

On Wed Jan 25 14​:02​:06 2012, pawel.pabian@​implix.com wrote​:

bbkr
rakudo​: class A { has Int $.id; }; class B is A { submethod BUILD (
:$!id = 10 ) { } }; B.new

p6eval
rakudo 3670b7​: OUTPUT«Null PMC access in get_pmc_keyed_str()â�¤ in
submethod BUILD at /tmp/NGnaIv23u2​:1â�¤ in method BUILDALL at
src/gen/CORE.setting​:583â�¤ in method bless at
src/gen/CORE.setting​:573â�¤ in method new at
src/gen/CORE.setting​:558â�¤ in block <anon> at /tmp/NGnaIv23u2​:1â�¤
in <�

This is now caught and reported at compile time. Giving for testing.

Thanks,

Jonathan

This was actually tested the next day. Closing ticket.

commit 4aeddd7ffa7ca5870ca4754b53170d6b3e6453dc
Author​: Moritz Lenz <moritz@​faui2k3.org>
Date​: Thu Jan 26 11​:47​:34 2012 +0100

  test for RT #​109064

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Nov 14, 2013

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

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

No branches or pull requests

1 participant