On Tue, 24 Jan 2017 17:11:13 -0800, raiph wrote:
> Golf'd to:
> 
> role A { method m {} }
> role B does A {}
> class C does A does B {}
> 
> Method 'm' must be resolved by class C because it exists in multiple roles
> (A, B)
> 
> Note that the same issue leads also to:
> 
> role A { has $a }
> role B does A {}
> class C does A does B {}
> 
> Attribute '$!a' conflicts in role composition
> 
> A number of devs discussed this on #perl6 with the useful part starting
> here:
> 
> https://irclog.perlgeek.de/perl6/2017-01-24#i_13982402
> 
> and ending with jnthn's thoughts.
> 

I have a fix for this, see:

https://gist.github.com/skids/18fa6fb1de776400abd43b6e82e9fcc2

I just have to resist Warnock's Dilemna and pester people just the riht amount
until someone has the time to review it so it can be improved a bit.

Also, RT#124749 can be combined with this.

Locally, using the above linked branch:

$ perl6 -e 'role A { method m { 42.say } }; role B does A {}; class C does A 
does B {}; C.new.m()'
42
$ perl6 -e 'role A { has $.a = 42 }; role B does A {} ; class C does A does B 
{}; C.new.a.say'
42

Reply via email to