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

Cannot bind to an attribute from a role #2581

Open
lizmat opened this issue Jan 4, 2019 · 0 comments
Open

Cannot bind to an attribute from a role #2581

lizmat opened this issue Jan 4, 2019 · 0 comments

Comments

@lizmat
Copy link
Contributor

lizmat commented Jan 4, 2019

role A {
    has Int $.a
}
class B does A {
    method b(\a) {
       $!a := a
    }
}
B.new.b(42)  # Type check failed in binding; expected NQPMu but got Int (42)

If we replace the $!a := a with nqp::bind($!a,a), then all is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants