Subject: | Nested class definitions seem to not work any more |
The following gives a runtime error:
Can't locate object method "new" via package "SubFoo" (perhaps you
forgot to load "SubFoo"?) at test_declare.pl line 13.
use MooseX::Declare;
use 5.010;
role Bar
{
sub baz { say 'Bar::baz called'; }
}
class Foo with Bar
{
sub anon
{
# nested class definition
class SubFoo with Bar { sub blarg { say 'SubFoo::blarg called'; } }
return SubFoo->new();
}
}
my $foo = Foo->new();
$foo->anon();