ensure constructor gets regenerated if forced early by metaclass inflation
Matt S Trout [Fri, 20 Jul 2012 17:14:56 +0000 (17:14 +0000)]
Changes
lib/Moo/HandleMoose.pm

diff --git a/Changes b/Changes
index 34bd81d..ec47b24 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,5 @@
+  - ensure constructor gets regenerated if forced early by metaclass inflation
+
 1.000000 - 2012-07-18
   - clean up doc language and expand on Moo and Moose
   - error prefixes for isa and coerce exceptions
index fb68afd..e03e49c 100644 (file)
@@ -23,6 +23,9 @@ sub maybe_reinject_fake_metaclass_for {
   my ($name) = @_;
   our %DID_INJECT;
   if (delete $DID_INJECT{$name}) {
+    unless ($Moo::Role::INFO{$name}) {
+      Moo->_constructor_maker_for($name)->install_delayed;
+    }
     inject_fake_metaclass_for($name);
   }
 }