From: Jesse Luehrs Date: Sun, 24 Apr 2011 20:14:05 +0000 (-0500) Subject: don't close over the type constraint for inlined tcs X-Git-Tag: 2.0100~35 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bd0683427b0b5f632411d1a69c5a86ce3049d481;p=gitmo%2FMoose.git don't close over the type constraint for inlined tcs --- diff --git a/lib/Moose/Meta/Method/Accessor.pm b/lib/Moose/Meta/Method/Accessor.pm index d8c8d3f..f736f25 100644 --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@ -43,11 +43,10 @@ sub _eval_environment { '$default' => \($attr->default), '$meta' => \$self, '$type_constraint_obj' => \$type_constraint_obj, - '$type_constraint' => \( - $type_constraint_obj - ? $type_constraint_obj->_compiled_type_constraint - : undef - ), + ($type_constraint_obj && !$type_constraint_obj->can_be_inlined + ? ('$type_constraint' + => \($type_constraint_obj->_compiled_type_constraint)) + : ()), ( $type_constraint_obj ? %{ $type_constraint_obj->inline_environment }