Add back rafl and rhesa's original changes and tweak them for steven's okay for defau...
[gitmo/Class-MOP.git] / lib / Class / MOP / Attribute.pm
index aba370d..37dc2f9 100644 (file)
@@ -248,7 +248,9 @@ sub get_write_method_ref {
 }
 
 sub is_default_a_coderef {
-    ('CODE' eq ref($_[0]->{'default'}))
+    my ($value) = $_[0]->{'default'};
+    return unless ref($value);
+    return ref($value) eq 'CODE' || (blessed($value) && $value->isa('Class::MOP::Method'));
 }
 
 sub default {