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

Assigning to an attribute from within BUILD gives Null PMC access in getprop() #786

Closed
p6rt opened this issue Mar 15, 2009 · 4 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Mar 15, 2009

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

Searchable as RT63902$

@p6rt
Copy link
Author

p6rt commented Mar 15, 2009

From @moritz

Rakudo 087e299898416ca6c3a6e2b2bdc3785d841f0ec6​:

From the parent​:
$ >./perl6 -e 'class P { submethod BUILD($o) { say self.WHAT; $o.doit(2)
} }; class C is P { has $!a; method doit($x) { $!a = $x; }}; C.new()'
P
Null PMC access in getprop()

In a class itself​:
$ ./perl6 -e 'class P { has $.foo; submethod BUILD($o) { $!foo = 3 }};
P.new'
Null PMC access in getprop()
current instr.​: 'infix​:=' pc 13972 (src/builtins/assign.pir​:21)
called from Sub 'parrot;P;BUILD' pc 225 (EVAL_20​:94)
called from Sub 'parrot;Perl6Object;BUILDALL' pc 1071
(src/classes/Object.pir​:371)
called from Sub '_block14' pc 74 (EVAL_20​:41)
called from Sub '!UNIT_START' pc 17161 (src/builtins/guts.pir​:325)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 950
(src/PCT/HLLCompiler.pir​:527)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1496
(src/PCT/HLLCompiler.pir​:787)
called from Sub 'parrot;Perl6;Compiler;main' pc 21458 (perl6.pir​:163)

@p6rt
Copy link
Author

p6rt commented Jun 3, 2009

From @jnthn

On Sun Mar 15 12​:00​:21 2009, moritz wrote​:

Rakudo 087e299898416ca6c3a6e2b2bdc3785d841f0ec6​:

From the parent​:
$ >./perl6 -e 'class P { submethod BUILD($o) { say self.WHAT; $o.doit(2)
} }; class C is P { has $!a; method doit($x) { $!a = $x; }}; C.new()'
P
Null PMC access in getprop()

In a class itself​:
$ ./perl6 -e 'class P { has $.foo; submethod BUILD($o) { $!foo = 3 }};
P.new'
Null PMC access in getprop()

Note that BUILD as per S12 does not take a positional parameter like for
the object, which is now corrected. And also this bug is too. We pass
all of S12-construction/BUILD.t, which I think is enough test coverage
to make this ticket closable.

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented Jun 3, 2009

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

@p6rt
Copy link
Author

p6rt commented Jun 3, 2009

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

@p6rt p6rt closed this as completed Jun 3, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant