sub _can_fix_metaclass_incompatibility {
my $self = shift;
- return $self->_can_fix_metaclass_incompatibility_by_subclassing(@_);
-}
-
-sub _can_fix_metaclass_incompatibility_by_subclassing {
- my $self = shift;
my ($super_meta) = @_;
- return 1 if $self->_can_fix_class_metaclass_incompatibility_by_subclassing($super_meta);
+ return 1 if $self->_class_metaclass_can_be_made_compatible($super_meta);
my %base_metaclass = $self->_base_metaclasses;
for my $metaclass_type (keys %base_metaclass) {
- return 1 if $self->_can_fix_single_metaclass_incompatibility_by_subclassing($metaclass_type, $super_meta);
+ return 1 if $self->_single_metaclass_can_be_made_compatible($super_meta, $metaclass_type);
}
return;
}
-sub _can_fix_class_metaclass_incompatibility_by_subclassing {
+sub _class_metaclass_can_be_made_compatible {
my $self = shift;
my ($super_meta) = @_;
- my $super_meta_name = $super_meta->_real_ref_name;
-
- return $self->_can_be_made_compatible_with($super_meta_name);
+ return $self->_can_be_made_compatible_with($super_meta->_real_ref_name);
}
-sub _can_fix_single_metaclass_incompatibility_by_subclassing {
+sub _single_metaclass_can_be_made_compatible {
my $self = shift;
- my ($metaclass_type, $super_meta) = @_;
+ my ($super_meta, $metaclass_type) = @_;
my $specific_meta = $self->$metaclass_type;
+
return unless $super_meta->can($metaclass_type);
my $super_specific_meta = $super_meta->$metaclass_type;
# this is a really odd case
return 1 unless defined $specific_meta;
- return $specific_meta->_can_be_made_compatible_with($super_specific_meta);
+ return 1 if $specific_meta->_can_be_made_compatible_with($super_specific_meta);
}
sub _fix_class_metaclass_incompatibility {
my $self = shift;
my ( $super_meta ) = @_;
- if ($self->_can_fix_class_metaclass_incompatibility_by_subclassing($super_meta)) {
+ if ($self->_class_metaclass_can_be_made_compatible($super_meta)) {
($self->is_pristine)
|| confess "Can't fix metaclass incompatibility for "
. $self->name
my $self = shift;
my ( $metaclass_type, $super_meta ) = @_;
- if ($self->_can_fix_single_metaclass_incompatibility_by_subclassing($metaclass_type, $super_meta)) {
+ if ($self->_single_metaclass_can_be_made_compatible($super_meta, $metaclass_type)) {
($self->is_pristine)
|| confess "Can't fix metaclass incompatibility for "
. $self->name
_class_metaclass_is_compatible _single_metaclass_is_compatible
_fix_metaclass_incompatibility _fix_class_metaclass_incompatibility
_fix_single_metaclass_incompatibility _base_metaclasses
- _can_fix_class_metaclass_incompatibility_by_subclassing
- _can_fix_single_metaclass_incompatibility_by_subclassing
- _can_fix_metaclass_incompatibility_by_subclassing
_can_fix_metaclass_incompatibility
+ _class_metaclass_can_be_made_compatible
+ _single_metaclass_can_be_made_compatible
_get_associated_single_metaclass
_make_metaobject_compatible