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 assign to attribute belonging to deriving class when object was blessed in base class in Rakudo #2339

Closed
p6rt opened this issue Jan 26, 2011 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jan 26, 2011

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

Searchable as RT82814$

@p6rt
Copy link
Author

p6rt commented Jan 26, 2011

From @masak

<masak> rakudo​: class A { method new { self.bless(*) } }; class B is A
{ has $.c is rw; method new { my $obj = callsame; say $obj.WHAT;
$obj.c = 42; return $obj } }; say B.new.c
<p6eval> rakudo 188755​: OUTPUT«B()␤Null PMC access in getprop()␤ in
'&infix​:<=>' at line 1␤ in 'B​::new' [...]
* masak submits rakudobug
<masak> it says it's a B, but I suspect it ain't.
<jnthn> Hm. It should be...
<masak> the error occurs when trying to assign to $.c, which is B-specific.
<jnthn> yeah...
<jnthn> 00​:11 < jnthn> Somebody should fix objects. :P
<masak> :)

@p6rt
Copy link
Author

p6rt commented Jan 15, 2012

From @jnthn

On Tue Jan 25 16​:34​:02 2011, masak wrote​:

<masak> rakudo​: class A { method new { self.bless(*) } }; class B is A
{ has $.c is rw; method new { my $obj = callsame; say $obj.WHAT;
$obj.c = 42; return $obj } }; say B.new.c
<p6eval> rakudo 188755​: OUTPUT«B()␤Null PMC access in getprop()␤ in
'&infix​:<=>' at line 1␤ in 'B​::new' [...]
* masak submits rakudobug
<masak> it says it's a B, but I suspect it ain't.
<jnthn> Hm. It should be...
<masak> the error occurs when trying to assign to $.c, which is
B-specific.
<jnthn> yeah...
<jnthn> 00​:11 < jnthn> Somebody should fix objects. :P
<masak> :)

Somebody did​:

class A { method new { self.bless(*) } }; class B is A { has $.c is
rw; method new { my $obj = callsame; say $obj.WHAT; $obj.c = 42; return
$obj } }; say B.new.c
B()
42

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Jan 15, 2012

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

@p6rt
Copy link
Author

p6rt commented Mar 4, 2012

From @moritz

Now tested in S12-class/inheritance.t.

@p6rt
Copy link
Author

p6rt commented Mar 4, 2012

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

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