class.c: clear method cache after remove_method.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-04-09 09:25:35 +09:00
parent c30e6ebe12
commit b1d0296a93
+4 -1
View File
@@ -2361,7 +2361,10 @@ mrb_remove_method(mrb_state *mrb, struct RClass *c, mrb_sym mid)
MRB_CLASS_ORIGIN(c);
h = c->mt;
if (h && mt_del(mrb, h, mid)) return;
if (h && mt_del(mrb, h, mid)) {
mrb_mc_clear_by_class(mrb, c);
return;
}
mrb_name_error(mrb, mid, "method '%n' not defined in %C", mid, c);
}