Class::MOP::Class->meta->immutable_metaclass;
$Class::MOP::Class::immutable_metaclass_cache{"Class::MOP::Class"}{"Class::MOP::Class::Immutable::Trait"} = Class::MOP::Class::Immutable::Class::MOP::Class->meta;
-$_->meta->make_immutable(
+Class::MOP::Class->initialize($_)->make_immutable(
inline_constructor => 1,
replace_constructor => 1,
constructor_name => "_new",
use Carp 'confess';
use Scalar::Util 'blessed', 'weaken';
-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} }
'Class::MOP::Method::Wrapped' => Class::MOP::Method::Wrapped->meta,
'Class::MOP::Instance' => Class::MOP::Instance->meta,
'Class::MOP::Object' => Class::MOP::Object->meta,
- 'Class::MOP::Class::Immutable::Trait' => Class::MOP::Class::Immutable::Trait->meta,
+ 'Class::MOP::Class::Immutable::Trait' => Class::MOP::Class->initialize('Class::MOP::Class::Immutable::Trait'),
'Class::MOP::Class::Immutable::Class::MOP::Class' => Class::MOP::Class::Immutable::Class::MOP::Class->meta,
);
Class::MOP::Attribute->meta,
Class::MOP::Class->meta,
Class::MOP::Class::Immutable::Class::MOP::Class->meta,
- Class::MOP::Class::Immutable::Trait->meta,
+ Class::MOP::Class->initialize('Class::MOP::Class::Immutable::Trait'),
Class::MOP::Instance->meta,
Class::MOP::Method->meta,
Class::MOP::Method::Accessor->meta,