Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / xs-src / MouseAttribute.xs
index 3e4ef8d..7a453fd 100644 (file)
@@ -339,7 +339,9 @@ CODE:
             else{
                 svp = hv_fetchs(args, "accessor", TRUE);
             }
-            sv_setsv(*svp, name);
+            if(!SvOK(*svp)) {
+                sv_setsv(*svp, name);
+            }
         }
         else if(strEQ(is, "bare")){
             /* do nothing, but might complain later about missing methods */
@@ -474,7 +476,7 @@ CODE:
     if(svp && sv_true(*svp)){
         if(!(has_default || has_builder)){
             mouse_throw_error(klass, NULL,
-                "You cannot have lazy attribute (%"SVf") without specifying "
+                "You cannot have a lazy attribute (%"SVf") without specifying "
                 "a default value for it", name);
         }
     }