require CMOP 0.93
[gitmo/Moose.git] / lib / Moose / Meta / Method / Constructor.pm
index 7e8e2f2..e25ae44 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 
 use Scalar::Util 'blessed', 'weaken', 'looks_like_number', 'refaddr';
 
-our $VERSION   = '0.88';
+our $VERSION   = '0.89_02';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use base 'Moose::Meta::Method',
@@ -43,11 +43,6 @@ sub new {
     return $self;
 }
 
-# This is here so can_be_inlined can be inherited by MooseX modules.
-sub _expected_constructor_class {
-    return 'Moose::Object';
-}
-
 ## method
 
 sub _initialize_body {
@@ -61,6 +56,10 @@ sub _initialize_body {
     # the author, after all, nothing is free)
     my $source = 'sub {';
     $source .= "\n" . 'my $_instance = shift;';
+
+    $source .= "\n" . q{Carp::cluck 'Calling new() on an instance is deprecated,'
+                        . ' please use (blessed $obj)->new' if blessed $_instance;};
+
     $source .= "\n" . 'my $class = Scalar::Util::blessed($_instance) || $_instance;';
 
     $source .= "\n" . 'return $class->Moose::Object::new(@_)';