use _new for inline constructors of meta objects
Yuval Kogman [Wed, 13 Aug 2008 21:18:41 +0000 (21:18 +0000)]
lib/Class/MOP.pm

index c56f63d..20ca98e 100644 (file)
@@ -733,8 +733,13 @@ undef Class::MOP::Instance->meta->{_package_cache_flag};
 # no actual benefits.
 
 $_->meta->make_immutable(
-    inline_constructor => 0,
-    inline_accessors   => 0,
+    ( $_->can("_new") ? (
+        inline_constructor => 1,
+        constructor_name   => "_new",
+    ) : (
+        inline_constructor => 0,
+    ) ),
+    inline_accessors => 0,
 ) for qw/
     Class::MOP::Package
     Class::MOP::Module