Fixed a bug in the compiled constructor - it was invoking BUILD
wu-lee [Fri, 3 Apr 2009 12:38:03 +0000 (13:38 +0100)]
methods in the reverse order.

lib/Mouse/Meta/Method/Constructor.pm

index 37e2505..24a2b3c 100644 (file)
@@ -170,7 +170,7 @@ sub _generate_BUILDALL {
     no warnings 'once';
     for my $klass ($meta->linearized_isa) {
         if (*{ $klass . '::BUILD' }{CODE}) {
-            push  @code, qq{${klass}::BUILD(\$instance, \$args);};
+            unshift  @code, qq{${klass}::BUILD(\$instance, \$args);};
         }
     }
     return join "\n", @code;