sub mk_accessors{
my $self = shift;
my $meta = $locate_metaclass->($self);
+ my $class = $meta->name;
+ confess("You are trying to modify ${class}, which has been made immutable, this is ".
+ "not supported. Try subclassing ${class}, rather than monkeypatching it")
+ if $meta->is_immutable;
+
for my $attr_name (@_){
$meta->remove_attribute($attr_name)
if $meta->find_attribute_by_name($attr_name);
sub mk_ro_accessors{
my $self = shift;
my $meta = $locate_metaclass->($self);
+ my $class = $meta->name;
+ confess("You are trying to modify ${class}, which has been made immutable, this is ".
+ "not supported. Try subclassing ${class}, rather than monkeypatching it")
+ if $meta->is_immutable;
for my $attr_name (@_){
$meta->remove_attribute($attr_name)
if $meta->find_attribute_by_name($attr_name);
sub mk_wo_accessors{
my $self = shift;
my $meta = $locate_metaclass->($self);
+ my $class = $meta->name;
+ confess("You are trying to modify ${class}, which has been made immutable, this is ".
+ "not supported. Try subclassing ${class}, rather than monkeypatching it")
+ if $meta->is_immutable;
for my $attr_name (@_){
$meta->remove_attribute($attr_name)
if $meta->find_attribute_by_name($attr_name);