From: Shawn M Moore Date: Wed, 7 Jan 2009 14:42:41 +0000 (+0000) Subject: Better metaclass incompatibility error messages X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d442dad0e64799c3f4aab9ee7fdfe5cffd01ff38;p=gitmo%2FClass-MOP.git Better metaclass incompatibility error messages --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 28c3bfb..6157947 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -162,16 +162,16 @@ sub check_metaclass_compatibility { : ref($meta)); ($self->isa($meta_type)) - || confess $self->name . "->meta => (" . (ref($self)) . ")" . + || confess $self->name . "'s metaclass => (" . (ref($self)) . ")" . " is not compatible with the " . - $class_name . "->meta => (" . ($meta_type) . ")"; + $class_name . "'s metaclass => (" . ($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)) - || confess $self->name . "->meta->instance_metaclass => (" . ($self->instance_metaclass) . ")" . + || confess $self->name . "'s instance metaclass => (" . ($self->instance_metaclass) . ")" . " is not compatible with the " . - $class_name . "->meta->instance_metaclass => (" . ($meta->instance_metaclass) . ")"; + $class_name . "'s instance metaclass => (" . ($meta->instance_metaclass) . ")"; } }