+ - fix possible infinite loop caused by subconstructor code
+
0.009_016 - 2012-04-12
- don't accidentally load Moo::HandleMoose during global destruction
- better docs for trigger (and initializer's absence)
sub _handle_subconstructor {
my ($self, $into, $name) = @_;
- if (my $gen = $self->{subconstructor_generator}) {
+ if (my $gen = $self->{subconstructor_handler}) {
' if ($class ne '.perlstring($into).') {'."\n".
- ' '.$gen.";\n".
- ' return $class->'.$name.'(@_)'.";\n".
+ $gen.
' }'."\n";
} else {
''
? ($con ? $con->construction_string : undef)
: ('$class->'.$target.'::SUPER::new(@_)')
),
- subconstructor_generator => (
- $class.'->_constructor_maker_for($class,'.perlstring($target).')'
+ subconstructor_handler => (
+ ' if ($Moo::MAKERS{$class}) {'."\n"
+ .' '.$class.'->_constructor_maker_for($class,'.perlstring($target).');'."\n"
+ .' return $class->new(@_)'.";\n"
+ .' }'."\n"
),
)
->install_delayed
--- /dev/null
+use strictures 1;
+use Test::More;
+
+{
+ package SubCon1;
+
+ use Moo;
+
+ has foo => (is => 'ro');
+
+ package SubCon2;
+
+ our @ISA = qw(SubCon1);
+}
+
+ok(SubCon2->new, 'constructor completes');
+
+done_testing;