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

Lvalue of default accessor of base class stores into same-named attribute of derived class in Rakudo #2237

Closed
p6rt opened this issue Oct 28, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Oct 28, 2010

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

Searchable as RT78678$

@p6rt
Copy link
Author

p6rt commented Oct 28, 2010

From @masak

<masak> rakudo​: class A { has $.x is rw; method foo { say $!x } };
class B is A { has $.x; method bar { say $!x } }; given B.new(​:x(42))
{ .A​::x = 5; .foo; .bar }
<p6eval> rakudo 479650​: OUTPUT«5␤5␤»
<masak> this, I posit, is RONG.
<masak> I don't know if that's in RT yet.
<sjohnson> heh
<masak> huh; actually I expected that to be 42\n42\n.
<masak> well, not "expected" as in "what correct Perl 6 should
produce" expected :)
<masak> but "expected" as in "how I thought rakudo would misbehave" expected
<masak> guess I can produce an entirely *different* bug out of it, then.
<masak> rakudo​: class A { has $.x is rw }; class B is A { has $.x };
given B.new(​:x(42)) { .A​::x = 5; say .x }
<p6eval> rakudo 479650​: OUTPUT«5␤»
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Apr 21, 2012

From @jnthn

On Thu Oct 28 14​:46​:12 2010, masak wrote​:

<masak> rakudo​: class A { has $.x is rw; method foo { say $!x } };
class B is A { has $.x; method bar { say $!x } }; given B.new(​:x(42))
{ .A​::x = 5; .foo; .bar }
<p6eval> rakudo 479650​: OUTPUT«5␤5␤»
<masak> this, I posit, is RONG.
<masak> I don't know if that's in RT yet.

Works fine these days​:

class A { has $.x is rw; method foo { say $!x } }; class B is A { has
$.x; method bar { say $!x } }; given B.new(​:x(42)) { .A​::x = 5; .foo; .bar }
5
42

<masak> huh; actually I expected that to be 42\n42\n.
<masak> well, not "expected" as in "what correct Perl 6 should
produce" expected :)
<masak> but "expected" as in "how I thought rakudo would misbehave"
expected
<masak> guess I can produce an entirely *different* bug out of it, then.
<masak> rakudo​: class A { has $.x is rw }; class B is A { has $.x };
given B.new(​:x(42)) { .A​::x = 5; say .x }
<p6eval> rakudo 479650​: OUTPUT«5␤»

This one also works fine​:

class A { has $.x is rw }; class B is A { has $.x }; given
B.new(​:x(42)) { .A​::x = 5; say .x }
42

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Apr 21, 2012

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

@p6rt
Copy link
Author

p6rt commented Apr 22, 2012

From @moritz

Tested in S12-methods/accessors.t.

@p6rt
Copy link
Author

p6rt commented Apr 22, 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