don't invalidate the method map if we add a method object
[gitmo/Class-MOP.git] / lib / Class / MOP / Mixin / HasMethods.pm
index 2fe0135..939cd29 100644 (file)
@@ -83,6 +83,10 @@ sub add_method {
     }
 
     $self->add_package_symbol("&$method_name", $body);
+
+    # if we added the actual method object to the method map, we're still valid
+    $self->update_package_cache_flag
+        if blessed($method);
 }
 
 sub _code_is_mine {