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',
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 {
# 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(@_)';