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

Calling .WHAT on an attribute with the type of the surrounding class doesn't work in Rakudo #459

Closed
p6rt opened this issue Dec 6, 2008 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Dec 6, 2008

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

Searchable as RT61100$

@p6rt
Copy link
Author

p6rt commented Dec 6, 2008

From @masak

Rakudo r33577 can handle a .WHAT call on an attribute whose type is a class...

$ perl6 -e 'class A {}; class B { has A $.attr is rw }; my $b = B.new(
attr => A.new ); say $b.attr.WHAT'
A

...but not if the class happens to be the one in which the attribute
was declared.

$ perl6 -e 'class A { has A $.attr is rw }; my $b = A.new; $b.attr = $b'
Method 'ACCEPTS' not found for non-object
[...]

@p6rt
Copy link
Author

p6rt commented Dec 7, 2008

From @moritz

On Sat Dec 06 14​:04​:46 2008, masak wrote​:

Rakudo r33577 can handle a .WHAT call on an attribute whose type is a
class...

$ perl6 -e 'class A {}; class B { has A $.attr is rw }; my $b = B.new(
attr => A.new ); say $b.attr.WHAT'
A

...but not if the class happens to be the one in which the attribute
was declared.

$ perl6 -e 'class A { has A $.attr is rw }; my $b = A.new; $b.attr =
$b'
Method 'ACCEPTS' not found for non-object
[...]

Added tests for that to t/spec/S12-attributes/instance.t.

Moritz

@p6rt
Copy link
Author

p6rt commented Dec 7, 2008

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

@p6rt
Copy link
Author

p6rt commented Dec 17, 2008

From @jnthn

On Sun Dec 07 04​:18​:03 2008, moritz wrote​:

On Sat Dec 06 14​:04​:46 2008, masak wrote​:

Rakudo r33577 can handle a .WHAT call on an attribute whose type is a
class...

$ perl6 -e 'class A {}; class B { has A $.attr is rw }; my $b = B.new(
attr => A.new ); say $b.attr.WHAT'
A

...but not if the class happens to be the one in which the attribute
was declared.

$ perl6 -e 'class A { has A $.attr is rw }; my $b = A.new; $b.attr =
$b'
Method 'ACCEPTS' not found for non-object
[...]

Taking ticket; will deal with this after the rakudoreg changes are in.

Jonathan

@p6rt
Copy link
Author

p6rt commented Mar 29, 2009

From @moritz

This works now, tests are unfudge.

@p6rt p6rt closed this as completed Mar 29, 2009
@p6rt
Copy link
Author

p6rt commented Mar 29, 2009

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant