don't invalidate the method map if we add a method object
Jesse Luehrs [Tue, 16 Nov 2010 17:01:03 +0000 (11:01 -0600)]
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 {