From: Chris Prather Date: Mon, 25 May 2009 16:51:38 +0000 (-0400) Subject: remove required => 1 from lazy_build X-Git-Tag: 0.80~66 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=24b0aad2dd056a372ccf4c80766b98d31ead7101;p=gitmo%2FMoose.git remove required => 1 from lazy_build --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 8ca92cc..54ba639 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -348,7 +348,6 @@ sub _process_options { $class->throw_error("You can not use lazy_build and default for the same attribute ($name)", data => $options) if exists $options->{default}; $options->{lazy} = 1; - $options->{required} = 1; $options->{builder} ||= "_build_${name}"; if ($name =~ /^_/) { $options->{clearer} ||= "_clear${name}"; diff --git a/t/020_attributes/012_misc_attribute_tests.t b/t/020_attributes/012_misc_attribute_tests.t index ad66b63..69614d8 100644 --- a/t/020_attributes/012_misc_attribute_tests.t +++ b/t/020_attributes/012_misc_attribute_tests.t @@ -215,7 +215,6 @@ use Test::Exception; my $_foo_attr = $meta->get_attribute("_foo"); ok($foo_attr->is_lazy, "foo is lazy"); - ok($foo_attr->is_required, "foo is required"); ok($foo_attr->is_lazy_build, "foo is lazy_build"); ok($foo_attr->has_clearer, "foo has clearer");