honour BUILDARGS when calling $meta->new_object on behalf of Moose
Matt S Trout [Fri, 3 Aug 2012 16:44:08 +0000 (16:44 +0000)]
Changes
lib/Moo.pm

diff --git a/Changes b/Changes
index 11a9588..afb921a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,4 @@
+  - honour BUILDARGS when calling $meta->new_object on behalf of Moose
   - throw an error on invalid builder (RT#78479)
   - require D::GD 0.07 to avoid prototype mismatch errors
   - fix stupid typo in new Sub::Quote section
index 43f826d..545db75 100644 (file)
@@ -162,7 +162,7 @@ sub _constructor_maker_for {
           .'        '.$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"
+          .'        return $meta->new_object($class->BUILDARGS(@_));'."\n"
           .'      }'."\n"
         ),
       )