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> r: role R[::T] {}; class B {}; class C does R[B] {}; say "alive"
<p6eval> rakudo 35b2a9: OUTPUT«alive»
<masak> r: role R[::T] {}; class B {}; class C is R[B] {}
<p6eval> rakudo 35b2a9: OUTPUT«===SORRY!===Cannot call
'trait_mod:<is>'; none of these signatures match: [...]
<masak> std: role R[::T] {}; class B {}; class C is R[B] {}
<p6eval> std 7deb9d7: OUTPUT«ok 00:00 45m»
<masak> I realize that Rakudo doesn't have much to work with here...
<masak> (it's essentially the same situation as earlier, with
trait_mod:<is> doing all the heavy lifting, and we shouldn't muck too
much with that)
<masak> ...but I had to realize all on my own that I had used 'is'
where I shoulda used 'does'.
<masak> jnthn: is that worth a rakudobug, or should I just write code
correctly from the beginning? :P
<jnthn> masak: um, I thought we should pun the role into a class and
inherit from that.
<jnthn> masak: So file a "prolly shunt fail at all" bug :)
* masak files a "prolly shunt fail at all" rakudobug
<masak> r: role R[::T] {}; class B {}; class C does R[B] {}; say "alive"
<p6eval> rakudo 35b2a9: OUTPUT«alive»
<masak> r: role R[::T] {}; class B {}; class C is R[B] {}
<p6eval> rakudo 35b2a9: OUTPUT«===SORRY!===Cannot call
'trait_mod:<is>'; none of these signatures match: [...]
The problem is that Rakudo parses "C is R[B]" as trait_mod:<is>(C, R, [B]), rather than trait_mod:<is>(C, R[B]).
<masak> std: role R[::T] {}; class B {}; class C is R[B] {}
<p6eval> std 7deb9d7: OUTPUT«ok 00:00 45m»
STD parses that the same way as Rakudo, but I don't think we should clone the action behavior of <typename> (which handles "does R[B]") inside the action method of trait_mod:is.
Migrated from rt.perl.org#116465 (status was 'open')
Searchable as RT116465$
The text was updated successfully, but these errors were encountered: