Skip Menu |

This queue is for tickets about the Moo CPAN distribution.

Report information
The Basics
Id: 82309
Status: resolved
Priority: 0/
Queue: Moo

People
Owner: Nobody in particular
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.000007
Fixed in: (no value)



Subject: default attribute-named accessor still created if 'reader' and 'writer' options specified
Moo still creates the default attribute-named accessor even if reader & writer are specified:

Show quoted text
=============================

{
  package Foo;
  use Moo;

  has a => (
    is => 'rw',
    reader => 'get',
    writer => 'set',
   );
}

Foo->new->a;

Show quoted text
=============================


I would expect this code to die with a message like

Can't locate object method "a" via package "Foo"

I discovered this when I applied modifiers to 'get' and 'set' to monitor them and code which mistakenly used the default accessor name avoided the monitoring code.





A fix for that is already in the repo, it still needs some sanity- checking and polishing though. :)
On Fri Dec 28 17:03:17 2012, MITHALDU wrote:
Show quoted text
> A fix for that is already in the repo, it still needs some sanity-
> checking and polishing though. :)

Excellent!   Thanks.

Diab

The fix for this has been released in version 1.000008.