From: Jesse Luehrs Date: Tue, 23 Jun 2009 05:22:49 +0000 (-0500) Subject: make CMOP::Immutable::Trait stop lying about its metaclass X-Git-Tag: 0.88~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db8e5eee303c3cca41c93e77065abedba9ed91fa;p=gitmo%2FClass-MOP.git make CMOP::Immutable::Trait stop lying about its metaclass Class::MOP::Class is an immutable class, so its metaclass really does need to be the immutable version of itself (Class::MOP::Class::Immutable::Class::MOP::Class). Hiding this just causes confusing issues. Class::MOP::Class::Immutable::Class::MOP::Class isa Class::MOP::Class, so this shouldn't actually affect the behavior of any code (that wasn't doing things wrong to begin with). --- diff --git a/lib/Class/MOP/Class/Immutable/Trait.pm b/lib/Class/MOP/Class/Immutable/Trait.pm index 9992b49..f19b6c7 100644 --- a/lib/Class/MOP/Class/Immutable/Trait.pm +++ b/lib/Class/MOP/Class/Immutable/Trait.pm @@ -12,29 +12,6 @@ our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; -sub meta { - my $self = shift; - - # if it is not blessed, then someone is asking - # for the meta of Class::MOP::Class:;Immutable::Trait - return Class::MOP::Class->initialize($self) unless blessed($self); - - # otherwise, they are asking for the metaclass - # which has been made immutable, which is itself - # except in the cases where it is a metaclass itself - # that has been made immutable and for that we need - # to dig a bit ... - - if ( $self->isa('Class::MOP::Class') ) { - - # except this is a lie... oh well - return Class::MOP::class_of( $self->get_mutable_metaclass_name ); - } - else { - return $self; - } -} - # the original class of the metaclass instance sub get_mutable_metaclass_name { $_[0]{__immutable}{original_class} }