Subject: | extends with multiple args not setting attribute defaults properly for second arg |
NB: I understand multi-arg extends() is a bad idea. However...
If I have a class that extends two other classes, the attributes from the first argument are fine, but the second argument never has its attribute defaults set.
I've attached a very simple test case.
Subject: | multi-extends-default.pl |
package A;
use Moo;
has 'a' => ( is => 'rw', default => 0 );
package B;
use Moo;
has 'b' => ( is => 'rw', default => 0 );
package C;
use Moo;
extends 'A', 'B';
package main;
use Test::More tests => 2;
my $c = C->new;
is( $c->a, 0, 'accessor from A' );
is( $c->b, 0, 'accessor from B' );