Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: rt [...] illuminated.co.uk
Cc:
AdminCc:

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
https://metacpan.org/pod/Moose::Meta::Attribute::Native::Trait::Number 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.