Subject: | has '+foo' doesn't work between roles |
$ cat try.pl
#!/usr/bin/env perl
use strict;
use warnings;
{
package RoleA;
use Moo::Role;
has 'foo' => (
is => 'ro',
required => 1,
);
}
{
package RoleB;
use Moo::Role;
has '+foo' => (
default => sub { 42 },
);
}
__END__
$ perl try.pl
Must have an is at try.pl line 21.
I would have expected RoleB to end up with the equivalent of
has 'foo' => (
is => 'ro',
required => 1,
default => sub { 42 },
);
Instead it seems like the '+' is just ignored.