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

Bug in "use Mojo::Base -role": conflicts about "has" #1170

Closed
aferreira opened this issue Dec 19, 2017 · 0 comments
Closed

Bug in "use Mojo::Base -role": conflicts about "has" #1170

aferreira opened this issue Dec 19, 2017 · 0 comments

Comments

@aferreira
Copy link
Contributor

If one tries to compose two or more roles built with use Mojo::Base -role, as in the example below:

package Boo; use Mojo::Base -role;
package Foo; use Mojo::Base -role;

Mojo::Base->with_roles('Boo', 'Foo')

the following error is encountered

Method name conflict for 'has' between roles 'Boo' and 'Foo', cannot apply these simultaneously to an object.

That happens because has is imported to the caller namespace after the package has become a Role::Tiny

vs

That makes Role::Tiny to think has is a method which should be part of the role composition.

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

No branches or pull requests

1 participant