HaloO, Jonathan Lang wrote:
Please, no attempts to merge signatures. Instead, use multiple dispatch
That avoids the problem before it occurs. But do you expect every role to provide its methods as multi just in case?
Also, sub is an odd choice to use while illustrating role composition; while subs _are_ allowed in roles AFAIK, they're generally not put there. Methods and submethods are by far more common.
The problem remains the same. After method lookup the arrow type of the non-invocant parameters has to be a contra-variant supertype of the two merged signatures. This signature is then a requirement to the composed class that indirectly does both roles. Regards, TSa. --