From: Matt S Trout Date: Sun, 22 Apr 2012 20:25:39 +0000 (+0000) Subject: undefer subs before metaclass inflation X-Git-Tag: v0.091000~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=46269e18c88840523ca8f64d5ed5f5146d3ba249;p=gitmo%2FMoo.git undefer subs before metaclass inflation --- diff --git a/Changes b/Changes index a4ae541..273687f 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,4 @@ + - undefer all subs before creating a concrete Moose metaclass - fix bug in _load_module where global vars could cause mis-detection of the module already being loaded diff --git a/lib/Moo/HandleMoose.pm b/lib/Moo/HandleMoose.pm index 6656e14..68627cd 100644 --- a/lib/Moo/HandleMoose.pm +++ b/lib/Moo/HandleMoose.pm @@ -50,6 +50,8 @@ sub inject_real_metaclass_for { } }; my %methods = %{Role::Tiny->_concrete_methods_of($name)}; + # needed to ensure the method body is stable and get things named + Sub::Defer::undefer_sub($_) for grep defined, values %methods; my @attrs; { # This local is completely not required for roles but harmless