On 27 March 2015 at 11:23, Diab Jerius <djer...@cfa.harvard.edu> 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. > > I've attached simplified versions of the pre- and post- Moo code. The > pre-Moo code generates this: > > $ perl tst1 > b1 > b2 > > The Moo code outputs this: > > $ perl tst2 > b1 > Use of uninitialized value in say at tst2 line 30. > > In tst2, if I explicitly initialize the attribute from the second class: > > my $q = C11->new( b2 => 'BBB' ); > > It is still output as uninitialized. > > Would someone please point out what I'm missing? > > Thanks, > > Diab > Given the code works as expected when you s/Moo/Moose/, both in value initialization, and in explicitly passing arguments to the second-inherited 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 ) -- Kent *KENTNL* - https://metacpan.org/author/KENTNL