+ - Don't generate an accessor for rw attributes if reader+writer both set
- Support builder => sub {} ala MooseX::AttributeShortcuts
- Fix 'no Moo;' to preserve non-sub package variables
- Switch to testing for Mouse::Util->can('find_meta') to avoid
if ($is eq 'ro') {
$spec->{reader} = $name unless exists $spec->{reader};
} elsif ($is eq 'rw') {
- $spec->{accessor} = $name unless exists $spec->{accessor};
+ $spec->{accessor} = $name unless exists $spec->{accessor}
+ or ( $spec->{reader} and $spec->{writer} );
} elsif ($is eq 'lazy') {
$spec->{reader} = $name unless exists $spec->{reader};
$spec->{lazy} = 1;
reader => 'get_one',
writer => 'set_one',
);
+
+ sub one {'sub'}
}
{
is( $foo->get_one, 'lol', 'reader works' );
$foo->set_one('rofl');
is( $foo->get_one, 'rofl', 'writer works' );
+is( $foo->one, 'sub', 'reader+writer = no accessor' );
ok( exception { $foo->get_one('blah') }, 'reader dies on write' );