Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 125855
Status: new
Priority: 0/
Queue: Moose

Owner: Nobody in particular
Requestors: rt [...]

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)

Subject: The documentation for Moose::Meta::Attribute::Native::Trait::Number shouldn't claim its attribute is ro
Download (untitled) / with headers
text/plain 660b says in the synopsis Show quoted text
> package Real; > use Moose; > > has 'integer' => ( > traits => ['Number'], > is => 'ro', > ... > ); > > my $real = Real->new(); > $real->add(5); # same as $real->integer($real->integer + 5);
The problem is that saying $real->integer($real->integer + 5) would trigger a "Cannot assign a value to a read-only accessor" error. At the very least the documentation should mention that you can get around an attribute value being modifiable this way by using method delegation. Or it should avoid mentioning this and just have the example attribute be rw.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to