Skip to content

Commit

Permalink
class.c: clear method cache after remove_method.
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Apr 9, 2022
1 parent c30e6eb commit b1d0296
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/class.c
Expand Up @@ -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);
}

Expand Down

0 comments on commit b1d0296

Please sign in to comment.