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 do 'handles' on a type in Rakudo #2319

Open
p6rt opened this issue Jan 1, 2011 · 3 comments
Open

Can't do 'handles' on a type in Rakudo #2319

p6rt opened this issue Jan 1, 2011 · 3 comments
Labels
NYI Features not yet implemented

Comments

@p6rt
Copy link

p6rt commented Jan 1, 2011

Migrated from rt.perl.org#81548 (status was 'open')

Searchable as RT81548$

@p6rt
Copy link
Author

p6rt commented Jan 1, 2011

From @masak

<masak> rakudo​: class A { has @​.b handles Array }; my $a = A.new; say
$a.b.perl; $a.push(1, 2, 3); say $a.b.perl
<p6eval> rakudo b570a2​: OUTPUT«[]␤Method 'push' not found for invocant
of class 'A'␤ in main program body at line 22​:/tmp/KrHSBT37lh␤»
<masak> aww.
* masak submits rakudobug
<masak> would have been really cool if that worked...
<moritz_> what's the bug?
<masak> S12​:1366​: "If you say C<has $.fur is rw handles Groomable;>
then you get only those methods available via the C<Groomable> role or
class."
<moritz_> ah.
<masak> by extension, I expected to get the methods available via Array.

@p6rt
Copy link
Author

p6rt commented Jan 5, 2011

From @moritz

FWIW 'has $!a handles TypeObject' is now implemented, and works fine for
roles.

It doesn't work for classes, because they have a .new method. So the
standard .new is overridden, trying to call the .new on an attribute,
but since there's no instance yet, the access to the attribute fails.

That's a conceptual problem and needs a spec resolution.

One possible approach would be to only install methods not yet present
in $?CLASS or its superclassess.... any better ideas?

Moritz

@p6rt
Copy link
Author

p6rt commented Jan 5, 2011

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

@p6rt p6rt added the NYI Features not yet implemented label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NYI Features not yet implemented
Projects
None yet
Development

No branches or pull requests

1 participant