From: Stevan Little Date: Fri, 10 Nov 2006 16:44:18 +0000 (+0000) Subject: missed sumpin X-Git-Tag: 0_18_002~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7bffa230cb5d051d895a8393dcc0b096b91f24e0;p=gitmo%2FMoose.git missed sumpin --- diff --git a/lib/Moose/Meta/Method/Accessor.pm b/lib/Moose/Meta/Method/Accessor.pm index 57041a6..1934a50 100644 --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@ -81,6 +81,13 @@ sub generate_reader_method_inline { . $self->_inline_check_lazy . 'return ' . $self->_inline_auto_deref( '$_[0]->{$attr_name}' ) . ';' . '}'; + + # NOTE: + # set up the environment + my $type_constraint = $attr->type_constraint + ? $attr->type_constraint->_compiled_type_constraint + : undef; + my $sub = eval $code; confess "Could not create reader for '$attr_name' because $@ \n code: $code" if $@; return $sub;