From: Jesse Luehrs Date: Sat, 13 Nov 2010 21:49:20 +0000 (-0600) Subject: get_package_symbol no longer calls add_package_symbol X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7f3c3fba87635344a1b188c1f8fc15da575c091c;p=gitmo%2FClass-MOP.git get_package_symbol no longer calls add_package_symbol --- diff --git a/lib/Class/MOP/Class/Immutable/Trait.pm b/lib/Class/MOP/Class/Immutable/Trait.pm index 73541d8..e2da673 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__