=item Reversed logic when defining which options can be changed
-L<Moose::Meta::Attribute> now uses reversed logic when defining which
-options can be changed. By default all options are allowed to be
-changed. The previous behaviour required each option to be whitelisted
-for changing using C<legal_options_for_inheritance> method. This
-method has been removed. New method C<illegal_options_for_inheritance>
-can now be used to prevent certain options from being changeable.
+L<Moose::Meta::Attribute> now allows all options to be changed in an
+overridden attribute. The previous behaviour required each option to be
+whitelisted using the C<legal_options_for_inheritance> method. This method has
+been removed, and there is a new method, C<illegal_options_for_inheritance>,
+which can now be used to prevent certain options from being changeable.
-This also now only throws an error if the illegal option was actually
-changed. If the superclass version of an attribute didn't specify this
-option at all, the subclass version can still add it as an option.
+In addition, we only throw an error if the illegal option is actually
+changed. If the superclass didn't specify this option at all when defining the
+attribute, the subclass version can still add it as an option.
Example of overriding this in an attribute trait:
use Moose::Role;
has 'my_illegal_option' => (
- isa => 'CodeRef',
- is => 'rw',
+ isa => 'CodeRef',
+ is => 'rw',
);
around illegal_options_for_inheritance => sub {
- return (shift->(@_), qw/my_illegal_option/);
+ return ( shift->(@_), qw/my_illegal_option/ );
};
=back