From: Dave Rolsky Date: Tue, 17 Aug 2010 16:12:44 +0000 (+0200) Subject: Changes to work with latest Moose, which changed how defaults are handled in inline... X-Git-Tag: 0.25~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4793015bed7acd4be4ae858065f04f96df8c268c;p=gitmo%2FMooseX-Singleton.git Changes to work with latest Moose, which changed how defaults are handled in inline constructor --- diff --git a/lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm b/lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm index 0521977..650764f 100644 --- a/lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm +++ b/lib/MooseX/Singleton/Role/Meta/Method/Constructor.pm @@ -48,11 +48,14 @@ override _initialize_body => sub { = map { defined $_ ? $_->_compiled_type_constraint : undef; } @type_constraints; + my $defaults = [map { $_->default } @$attrs]; + my ( $code, $e ) = $self->_compile_code( code => $source, environment => { '$meta' => \$self, '$attrs' => \$attrs, + '$defaults' => \$defaults, '@type_constraints' => \@type_constraints, '@type_constraint_bodies' => \@type_constraint_bodies, },