From: Matt S Trout Date: Tue, 26 Jun 2012 17:30:44 +0000 (+0000) Subject: subconstructor handling for Moose classes X-Git-Tag: v0.091010~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=346177bab5c218a8c4a77180e4f9f1317251de55;p=gitmo%2FMoo.git subconstructor handling for Moose classes --- diff --git a/Changes b/Changes index 508c4a3..cef0abb 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - subconstructor handling for Moose classes + 0.091009 - 2012-06-20 - squelch redefine warnings in the coderef installation code diff --git a/lib/Moo.pm b/lib/Moo.pm index 6aa9cd2..2034459 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -137,6 +137,8 @@ sub _constructor_maker_for { ' if ($Moo::MAKERS{$class}) {'."\n" .' '.$class.'->_constructor_maker_for($class,'.perlstring($target).');'."\n" .' return $class->new(@_)'.";\n" + .' } elsif ($INC{"Moose.pm"} and my $meta = Class::MOP::get_metaclass_by_name($class)) {'."\n" + .' return $meta->new_object(@_);'."\n" .' }'."\n" ), )