implementation of FOREIGNBUILDARGS
Graham Knop [Fri, 22 Feb 2013 09:59:21 +0000 (04:59 -0500)]
lib/Moo.pm

index a6c6fc1..9ae0141 100644 (file)
@@ -165,7 +165,7 @@ sub _constructor_maker_for {
         construction_string => (
           $moo_constructor
             ? ($con ? $con->construction_string : undef)
-            : ('$class->'.$target.'::SUPER::new(@_)')
+            : ('$class->'.$target.'::SUPER::new($class->can(q[FOREIGNBUILDARGS]) ? $class->FOREIGNBUILDARGS(@_) : @_)')
         ),
         subconstructor_handler => (
           '      if ($Moo::MAKERS{$class}) {'."\n"