17 clearer => 'clear_bar',
27 ::lives_ok { has '+foo' => (is => 'rw') } "can override is";
28 ::throws_ok { has '+foo' => (reader => 'bar') } qr/illegal/, "can't override reader";
29 ::lives_ok { has '+foo' => (clearer => 'baz') } "can override unspecified things";
31 ::throws_ok { has '+bar' => (clearer => 'quux') } qr/illegal/, "can't override clearer";
32 ::lives_ok { has '+bar' => (predicate => 'has_bar') } "can override unspecified things";
36 package Bar::Meta::Attribute;
39 has my_illegal_option => (is => 'ro');
41 around illegal_options_for_inheritance => sub {
42 return (shift->(@_), 'my_illegal_option');
52 traits => ['Bar::Meta::Attribute'],
53 my_illegal_option => 'FOO',
56 } "can use illegal options";
59 traits => ['Bar::Meta::Attribute'],
70 ::throws_ok { has '+bar' => (my_illegal_option => 'BAR') }
72 "can't override illegal attribute";
73 ::lives_ok { has '+baz' => (my_illegal_option => 'BAR') }
74 "can add illegal option if superclass doesn't set it";
77 my $bar_attr = Bar->meta->get_attribute('bar');
78 ok((grep { $_ eq 'my_illegal_option' } $bar_attr->illegal_options_for_inheritance) > 0, '... added my_illegal_option as illegal option for inheritance');