From: Dave Rolsky Date: Thu, 19 Feb 2009 21:33:15 +0000 (+0000) Subject: Clarify variable naming here X-Git-Tag: 0.77_01~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8045bcc5951d7747ca711e09a2587dd1f5c55baf;p=gitmo%2FClass-MOP.git Clarify variable naming here --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 1f847ab..4d97640 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -157,28 +157,29 @@ sub check_metaclass_compatibility { my @class_list = $self->linearized_isa; shift @class_list; # shift off $self->name - foreach my $class_name (@class_list) { - my $meta = Class::MOP::get_metaclass_by_name($class_name) || next; + foreach my $superclass_name (@class_list) { + my $super_meta = Class::MOP::get_metaclass_by_name($superclass_name) || next; # NOTE: # we need to deal with the possibility # of class immutability here, and then # get the name of the class appropriately - my $meta_type = ($meta->is_immutable - ? $meta->get_mutable_metaclass_name() - : ref($meta)); + my $super_meta_type + = $super_meta->is_immutable + ? $super_meta->get_mutable_metaclass_name() + : ref($super_meta); - ($self->isa($meta_type)) + ($self->isa($super_meta_type)) || confess $self->name . "->meta => (" . (ref($self)) . ")" . " is not compatible with the " . - $class_name . "->meta => (" . ($meta_type) . ")"; + $class_name . "->meta => (" . ($super_meta_type) . ")"; # NOTE: # we also need to check that instance metaclasses # are compatibile in the same the class. - ($self->instance_metaclass->isa($meta->instance_metaclass)) + ($self->instance_metaclass->isa($super_meta->instance_metaclass)) || confess $self->name . "->meta->instance_metaclass => (" . ($self->instance_metaclass) . ")" . " is not compatible with the " . - $class_name . "->meta->instance_metaclass => (" . ($meta->instance_metaclass) . ")"; + $class_name . "->meta->instance_metaclass => (" . ($super_meta->instance_metaclass) . ")"; } }