Subject: | Staged attributed declaration does not work in roles |
Given this works:
perl -e '
use Moo;
has foo => is => "lazy";
has "+foo" => default => 42;
warn __PACKAGE__->new->foo
'
it is surprising that this *doesn't*:
perl -e '
{
package SomeRole;
use Moo::Role;
has foo => is => "lazy";
has "+foo" => default => 42;
}
use Moo;
with "SomeRole";
warn __PACKAGE__->new->foo
'