Appending a block to an anonymous class definition composed with a role,
gives a syntax error.
use MooseX::Declare;
use 5.010;
role Bar
{
sub baz { say 'Bar::baz called'; }
}
class Foo with Bar
{
sub anon
{
# works
class SubFoo with Bar { sub blarg { say 'SubFoo::blarg called'; } }
# works
my $class1 = class with Bar;
# doesn't work and throws syntax error: syntax error at
test_declare.pl line 18, near "'Bar' sub yarp "
my $class2 = class with Bar { sub yarp { say 'anon yarp called' } };
}
}