# Class::MOP::Class singletons here, they
# should not be cloned.
return $instance if $instance->isa('Class::MOP::Class');
- $class->clone_instance($instance, @_);
+ $class->_clone_instance($instance, @_);
}
sub clone_instance {
+ warn 'The clone_instance method has been made private.'
+ . " The public version is deprecated and will be removed in a future release.\n";
+ goto &_clone_instance;
+}
+
+sub _clone_instance {
my ($class, $instance, %params) = @_;
(blessed($instance))
|| confess "You can only clone instances, ($instance) is not a blessed instance";
use strict;
use warnings;
-use Test::More tests => 250;
+use Test::More tests => 252;
use Test::Exception;
use Class::MOP;
new_object clone_object
construct_instance
construct_class_instance _construct_class_instance
- clone_instance
+ clone_instance _clone_instance
rebless_instance
check_metaclass_compatibility _check_metaclass_compatibility
use strict;
use warnings;
-use Test::More tests => 48;
+use Test::More tests => 47;
use Test::Exception;
use Class::MOP;
dies_ok {
Class::MOP::Class->clone_object(1);
} '... can only clone instances';
-
- dies_ok {
- Class::MOP::Class->clone_instance(1);
- } '... can only clone instances';
}
{