X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FClass%2FImmutable%2FTrait.pm;fp=lib%2FClass%2FMOP%2FClass%2FImmutable%2FTrait.pm;h=86c02cc1f4416f515135aa7a9404f7c698ec9bfd;hb=d004c8d565f9b314da7652e9368aeb4587ffaa3d;hp=0568ef795680083200d1f4c67e754179a1786bca;hpb=bd2550f8320262fe1ab10f6c0eedc960889d869f;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Class/Immutable/Trait.pm b/lib/Class/MOP/Class/Immutable/Trait.pm index 0568ef7..86c02cc 100644 --- a/lib/Class/MOP/Class/Immutable/Trait.pm +++ b/lib/Class/MOP/Class/Immutable/Trait.pm @@ -32,7 +32,7 @@ sub _immutable_cannot_call { Carp::confess "The '$name' method cannot be called on an immutable instance"; } -for my $name (qw/add_method alias_method remove_method add_attribute remove_attribute remove_package_symbol/) { +for my $name (qw/add_method alias_method remove_method add_attribute remove_attribute remove_package_symbol add_package_symbol/) { no strict 'refs'; *{__PACKAGE__."::$name"} = sub { _immutable_cannot_call($name) }; } @@ -80,15 +80,6 @@ sub _method_map { $self->{__immutable}{_method_map} ||= $self->$orig; } -sub add_package_symbol { - my $orig = shift; - my $self = shift; - confess "Cannot add package symbols to an immutable metaclass" - unless ( caller(3) )[3] eq 'Class::MOP::Package::get_package_symbol'; - - $self->$orig(@_); -} - 1; __END__