Add tests and fix for implicit object construction skipping BUILD &
[gitmo/MooseX-Singleton.git] / lib / MooseX / Singleton / Meta / Instance.pm
index c6a0a3c..a56db58 100644 (file)
@@ -16,7 +16,9 @@ sub get_singleton_instance {
     no strict 'refs';
     return ${"$instance\::singleton"} if defined ${"$instance\::singleton"};
 
-    return $instance->meta->construct_instance;
+    # We need to go through ->new in order to make sure BUILD and
+    # BUILDARGS get called.
+    return $instance->meta->name->new;
 }
 
 sub clone_instance {