Subject: | error reported at the wrong place in 2.0205 |
Date: | Tue, 11 Oct 2011 13:27:21 -0400 |
To: | bug-moose [...] rt.cpan.org |
From: | Mark Jason Dominus <mjd [...] plover.com> |
Consider this module:
package Foo;
use Moose;
warn "Moose version: ", Moose->VERSION(), "\n";
has attribute => (
lazy => 1,
);
It produces the following output:
---- BEGIN ENCLOSURE
Moose version: 2.0205
You cannot have a lazy attribute (attribute) without specifying a default value for it at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Attribute.pm line 472
Moose::Meta::Attribute::_process_lazy_option('Moose::Meta::Attribute', 'attribute', 'HASH(0x9f71720)') called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Attribute.pm line 302
Moose::Meta::Attribute::_process_options('Moose::Meta::Attribute', 'attribute', 'HASH(0x9f71720)') called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Attribute.pm line 88
Moose::Meta::Attribute::new('Moose::Meta::Attribute', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Attribute.pm line 114
Moose::Meta::Attribute::interpolate_class_and_new('Moose::Meta::Attribute', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Class.pm line 704
Moose::Meta::Class::_process_new_attribute('Moose::Meta::Class=HASH(0xa0e2280)', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Class.pm line 697
Moose::Meta::Class::_process_attribute('Moose::Meta::Class=HASH(0xa0e2280)', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Meta/Class.pm line 566
Moose::Meta::Class::add_attribute('Moose::Meta::Class=HASH(0xa0e2280)', 'attribute', 'definition_context', 'HASH(0x9e6e178)', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose.pm line 77
Moose::has('Moose::Meta::Class=HASH(0xa0e2280)', 'attribute', 'lazy', 1) called at /home/mjd/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/i686-linux/Moose/Exporter.pm line 356
Moose::has('attribute', 'lazy', 1) called at /tmp/bug line 5
---- BEGIN ENCLOSURE
Reporting the error at Moose/Meta/Attribute.pm line 472 is unhelpful.
It should be reported at line 5 (or 6) of /tmp/bug, where it actually
occurs.
Mark Jason Dominus mjd@plover.com