How is that a bug? My expectation would always be that SUPER is resolved in the context of the current package and that is the way it is documented in perlboot and perltoot along with pretty much anywhere else I've seen it mentioned in documentation.
True laziness is hard work
| [reply] |
This was actually something that I've never really thought about and at first blush was surprising (although given five minutes of thought, it makes perfect sense). The fact that $class->SUPER::method() doesn't consider the value of $class at all could be unexepected since in typical use, the method is resolved relative to the invocant. Moose's bare super keyword avoids any confusion by removing the invocant altogether. This makes it (virtually) impossible to try and call some other class's (or object's) parent method via SUPER (or super in Moose's case).
| [reply] [d/l] [select] |