Re: Moo, multiple-inheritance, unexpectedly uninitialized attributes
[email protected] (Diab Jerius) Sat, 28 Mar 2015 05:47:13 -0400
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <CADpyd5ARMimSsaqKLhQe1iD4X_MDN2=PiuXv34Qfa1bKEgASvg@mail.gmail.com> |
On Fri, Mar 27, 2015 at 9:01 AM, Dagfinn Ilmari Manns=C3=A5ker <[email protected]> wrote: > [email protected] (Dagfinn Ilmari > Manns=C3=A5ker) writes: > >> Kent Fredric <[email protected]> >> writes: >> >>> On 27 March 2015 at 11:23, Diab Jerius <[email protected]> wrote: >>> >>>> I've translated some code using multiple inheritance to Moo, and am >>>> seeing some unexpected behavior, namely that attributes inherited >>>> from the second parent class are not properly initialized. >> [=E2=80=A6] >>> Given the code works as expected when you s/Moo/Moose/, both in value >>> initialization, and in explicitly passing arguments to the second-inher= ited >>> module at construction time, I would agree that you have in fact found = a >>> bug in Moo. >>> >>> ( Unless of course Moo has some documentation about explicitly not >>> supporting multiple inheritance ) >> >> It doesn't. In fact, https://metacpan.org/pod/Moo#extends says =C2=ABMul= tiple >> superclasses can be passed for multiple inheritance but please consider >> using L<roles|Moo::Role> instead=C2=BB, and there's no mention of the >> limitation in https://metacpan.org/pod/Moo#INCOMPATIBILITIES-WITH-MOOSE. >> >> However, fixing it breaks a few tests that assert that it _doesn't_ >> work: >> >> The tests were changed to expect the current buggy behaviour in this >> commit: >> >> commit f7813a5f2834a9dc03c7abdc2a9c4be940caa4e0 >> Author: Graham Knop <[email protected]> >> Date: 2014-04-15 00:43:12 -0400 >> >> fix multiple inheritance tests for expected behavior > > I've fixed the bug and reverted this commit on the multi-extends-default > branch <https://github.com/moose/Moo/commit/multi-extends-default>. > Thanks