Resolve RT #57975: "Exception caught:" prefixes on "re-thrown" exceptions have been...
[gitmo/Mouse.git] / lib / Mouse / PurePerl.pm
index d1b2c27..6322710 100644 (file)
@@ -298,9 +298,9 @@ sub _initialize_object{
                 push @triggers_queue, [ $attribute->trigger, $object->{$slot} ];
             }
         }
-        elsif(!$is_cloning) { # no init arg, noop while cloning
+        else { # no init arg
             if ($attribute->has_default || $attribute->has_builder) {
-                if (!$attribute->is_lazy) {
+                if (!$attribute->is_lazy && !exists $object->{$slot}) {
                     my $default = $attribute->default;
                     my $builder = $attribute->builder;
                     my $value =   $builder                ? $object->$builder()
@@ -313,7 +313,7 @@ sub _initialize_object{
                         if ref($object->{$slot}) && $attribute->is_weak_ref;
                 }
             }
-            elsif($attribute->is_required) {
+            elsif(!$is_cloning && $attribute->is_required) {
                 $self->throw_error("Attribute (".$attribute->name.") is required");
             }
         }
@@ -720,7 +720,7 @@ Mouse::PurePerl - A Mouse guts in pure Perl
 
 =head1 VERSION
 
-This document describes Mouse version 0.55
+This document describes Mouse version 0.59
 
 =head1 SEE ALSO