X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod%2FAccessor.pm;h=fcee6b82f44ea583f29bcdf7ca745a05bf601b0c;hb=7e0e6837dcef39d945629cb04d5f4d7619b08034;hp=5cca92ed549730e38b8d60bf9ce7b181eae94547;hpb=1f6046f098167a6bc7699ad8d844d1b72c49f634;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method/Accessor.pm b/lib/Mouse/Meta/Method/Accessor.pm index 5cca92e..fcee6b8 100755 --- a/lib/Mouse/Meta/Method/Accessor.pm +++ b/lib/Mouse/Meta/Method/Accessor.pm @@ -75,7 +75,7 @@ sub _generate_accessor_any{ $class->throw_error("Unknown accessor type '$type'"); } - if ($attribute->is_lazy) { + if ($attribute->is_lazy and $type ne 'wo') { my $value; if (defined $builder){ @@ -88,7 +88,7 @@ sub _generate_accessor_any{ $value = '$default'; } - $accessor .= "els" if $type eq 'rw' || $type eq 'wo'; + $accessor .= "els" if $type eq 'rw'; $accessor .= "if(!exists $slot){\n"; if($should_coerce){ $accessor .= "$slot = \$constraint->coerce($value)"; @@ -182,7 +182,7 @@ Mouse::Meta::Method::Accessor - A Mouse method generator for accessors =head1 VERSION -This document describes Mouse version 0.51 +This document describes Mouse version 0.63 =head1 SEE ALSO