Subject: | Doesn't play well with traits |
The following code works correctly, but issues warnings:
use 5.010;
{
package Foo;
use Moose;
use MooseX::HasDefaults::RO;
has "some_value" => (
traits => ['Counter'],
isa => 'Int',
default => 0,
handles => { "inc_some_value" => 'inc' },
);
}
my $foo = Foo->new;
$foo->inc_some_value;
say $foo->some_value;
That outputs:
The some_value method in the Foo class was automatically created
by the native delegation trait for the some_value attribute. This
"default is" feature is deprecated. Explicitly set "is" or define
accessor names to avoid this at default.pl line 16.
1
I use traits fairly extensively and fatal warnings make my life a bit sad when this happens :)
Moose version 2.0801.
MooseX::HasDefaults version 0.03
Perl version 5.10.1
Cheers,
Ovid