Subject: | child classes cannot be slurpy if the parent is not |
It would appear that classes need to be slurpy all the way down; it is
not sufficient for a child class to be slurpy when a parent is not.
Unit test:
use strict;
use warnings;
use Test::More tests => 2;
use Test::Deep;
use Test::NoWarnings;
{
package Parent;
use Moose;
use MooseX::AlwaysCoerce;
}
{
package Child;
use Moose;
use MooseX::SlurpyConstructor;
extends 'Parent';
has extra_args => (
is => 'ro',
isa => 'HashRef',
slurpy => 1,
);
}
my $obj = Child->new(foo => 1);
cmp_deeply(
$obj->extra_args,
{ foo => 1 },
'extra arguments were slurped up',
);