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

RFC: Make role parameters reusable in does clauses #2546

Open
taboege opened this issue Dec 14, 2018 · 0 comments
Open

RFC: Make role parameters reusable in does clauses #2546

taboege opened this issue Dec 14, 2018 · 0 comments
Labels

Comments

@taboege
Copy link
Contributor

taboege commented Dec 14, 2018

The Problem

A parameterized role can't refer to its arguments in roles it does itself:

role B[$n] { method n { $n } }
role C[$n] does B[$n] { }
C[5].n.say # OUTPUT: (Mu)

Expected Behavior

The n method from B is there but the value is lost. I would have expected it to print "5". The syntax role C[$n] does B[$n] is legal and it seems natural that the latter $n is in the same scope as the role parameter.

@vrurg vrurg added the roles label Dec 13, 2019
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

2 participants