Revision history for Perl extension Moose
+0.03
+ * Moose::Meta::Class
+ - fixed the way attribute defaults are handled
+ during instance construction (bug found by chansen)
+
0.02 Tues. March 21, 2006
* Moose
- many more tests, fixing some bugs and
use Carp 'confess';
use Scalar::Util 'weaken';
-our $VERSION = '0.02';
+our $VERSION = '0.03';
use base 'Class::MOP::Class';
$val = $params{$init_arg} if exists $params{$init_arg};
# if nothing was in the %params, we can use the
# attribute's default value (if it has one)
- $val ||= $attr->default($instance) if $attr->has_default;
+ if (!defined $val && $attr->has_default) {
+ $val = $attr->default($instance);
+ }
if (defined $val) {
if ($attr->has_type_constraint) {
if ($attr->should_coerce && $attr->type_constraint->has_coercion) {