From 5792bd7149a30f7f43a739199d84603cc579f4e5 Mon Sep 17 00:00:00 2001 From: Thomas Marshall Date: Tue, 8 Oct 2024 17:30:51 +0100 Subject: Emit warning for other method redefinition types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit ensures warnings about `object_id` and `__send__` method redefinitions are emitted for other method types such as aliases, procs, and attr readers—anything except C functions. --- vm_method.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vm_method.c') diff --git a/vm_method.c b/vm_method.c index 4eb074bbd8..e436538f56 100644 --- a/vm_method.c +++ b/vm_method.c @@ -1062,7 +1062,7 @@ rb_method_entry_make(VALUE klass, ID mid, VALUE defined_class, rb_method_visibil } /* check mid */ if (mid == object_id || mid == id__send__) { - if (type == VM_METHOD_TYPE_ISEQ && search_method(klass, mid, 0)) { + if (type != VM_METHOD_TYPE_CFUNC && search_method(klass, mid, 0)) { rb_warn("redefining '%s' may cause serious problems", rb_id2name(mid)); } } -- cgit v1.2.3