Fix for default in a constructor reported and tested by rjbs :)
[gitmo/Mouse.git] / lib / Mouse / Object.pm
index 8c36df3..9921711 100644 (file)
@@ -39,7 +39,7 @@ sub new {
                     my $value = $attribute->has_builder
                               ? $instance->$builder
                               : ref($default) eq 'CODE'
-                                  ? $default->()
+                                  ? $default->($instance)
                                   : $default;
 
                     $attribute->verify_type_constraint($value)