From: Tokuhiro Matsuno Date: Thu, 4 Dec 2008 16:11:27 +0000 (+0000) Subject: bug fixed: BUILD method doesn't works X-Git-Tag: 0.19~136^2~39 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=63d74d7adc05bdf93288048a851adaefd6ffc8d3;p=gitmo%2FMouse.git bug fixed: BUILD method doesn't works --- diff --git a/lib/Mouse/Meta/Method/Constructor.pm b/lib/Mouse/Meta/Method/Constructor.pm index aee0a7f..77cced9 100644 --- a/lib/Mouse/Meta/Method/Constructor.pm +++ b/lib/Mouse/Meta/Method/Constructor.pm @@ -160,7 +160,7 @@ sub _generate_BUILDALL { no strict 'refs'; for my $klass ($meta->linearized_isa) { if (*{ $klass . '::BUILD' }{CODE}) { - push @code, qq{${klass}::BUILD->(\$instance, \$args);}; + push @code, qq{${klass}::BUILD(\$instance, \$args);}; } } return join "\n", @code; diff --git a/t/800_shikabased/003-make_immutable.t b/t/800_shikabased/003-make_immutable.t index 189a5b2..28ebaff 100644 --- a/t/800_shikabased/003-make_immutable.t +++ b/t/800_shikabased/003-make_immutable.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 6; use Test::Exception; { @@ -10,6 +10,7 @@ use Test::Exception; is => 'rw', required => 1, ); + sub BUILD { main::ok "calling BUILD in HardDog" } no Mouse; __PACKAGE__->meta->make_immutable; } @@ -21,6 +22,7 @@ use Test::Exception; is => 'rw', required => 1, ); + sub BUILD { main::ok "calling BUILD in SoftDog" } no Mouse; }