undefer subs before metaclass inflation
[gitmo/Moo.git] / lib / Moo / HandleMoose.pm
index 6656e14..68627cd 100644 (file)
@@ -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