NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Is it a bug or a feature? (Score:1)
Not completely into Moose yet, but isn't a role the equivalent of a Java interface?
In that case, the behaviour you describe has been implemented there as a intended feature: a regular class *implements* the interface.
Additionally, a role seems to also have the function of an abstract class as well. In Java, overriding concrete methods is, again, a feature you want.
If you don't want to override a method simply do not include a overloading method in the implementing class.
It looks like a (sensible) design dec
Re:Is it a bug or a feature? (Score:2)
Oh, and I forgot to respond to this bit:
If you don't want to override a method simply do not include a overloading method in the implementing class.
Easier said than done. When I am overriding a role's method but I don't know I'm overriding it, I would like to know that. Really. It's important to me. That's a huge part of the OO inheritance mess that roles are designed to avoid and here's one relatively common edge case that is ignored. So maybe I should just remember all of my method names? I don't think so:
Reply to This
Parent