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

Even parameterized roles should be punned to classes if inherited using 'is' in Rakudo #3032

Open
p6rt opened this issue Jan 20, 2013 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 20, 2013

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

Searchable as RT116465$

@p6rt
Copy link
Author

p6rt commented Jan 20, 2013

From @masak

<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

@p6rt
Copy link
Author

p6rt commented Mar 12, 2015

From @Mouq

On Sun Jan 20 14​:06​:41 2013, masak wrote​:

<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.

I'm not sure what a solution is at this time.

~Mouq

@p6rt
Copy link
Author

p6rt commented Mar 12, 2015

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

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

No branches or pull requests

1 participant