From: wu-lee Date: Fri, 3 Apr 2009 12:38:03 +0000 (+0100) Subject: Fixed a bug in the compiled constructor - it was invoking BUILD X-Git-Tag: 0.20~18 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=813197f336632fac08e61083b9ef3c8c46b0113b Fixed a bug in the compiled constructor - it was invoking BUILD methods in the reverse order. --- diff --git a/lib/Mouse/Meta/Method/Constructor.pm b/lib/Mouse/Meta/Method/Constructor.pm index 37e2505..24a2b3c 100644 --- a/lib/Mouse/Meta/Method/Constructor.pm +++ b/lib/Mouse/Meta/Method/Constructor.pm @@ -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;