Subject: | lazy_build - missing warning |
Date: | Sat, 15 May 2010 16:31:27 +0200 |
To: | bug-Moose [...] rt.cpan.org |
From: | schwiege <schwiege [...] gmx.net> |
test case follows ( and is attached as file ).
This should give a warning, but does not.
Thank you!
----
use strict;
use warnings;
use Test::More;
use Test::Warn;
{
package Bar;
use Moose;
use MooseX::Types::Moose qw/:all/;
has has_attr => (
is => 'ro',
isa => Str,
);
::warning_like {
has attr => (
is => 'ro',
isa => Str,
lazy_build => 1, # Causes the has_attr method to be overwritten
);
} qr/.*/;
sub _build_attr {}
}
done_testing;
use strict;
use warnings;
use Test::More;
use Test::Warn;
{
package Bar;
use Moose;
use MooseX::Types::Moose qw/:all/;
has has_attr => (
is => 'ro',
isa => Str,
);
::warning_like {
has attr => (
is => 'ro',
isa => Str,
lazy_build => 1, # Causes the has_attr method to be overwritten
);
} qr/.*/;
sub _build_attr {}
}
done_testing;