You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<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.
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?
Migrated from rt.perl.org#81548 (status was 'open')
Searchable as RT81548$
The text was updated successfully, but these errors were encountered: