summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authorThomas Marshall <[email protected]>2024-10-08 17:30:51 +0100
committerNobuyoshi Nakada <[email protected]>2024-10-10 12:53:11 +0900
commit5792bd7149a30f7f43a739199d84603cc579f4e5 (patch)
tree1f45a917849c1b21a7b6c8b739f8feeddb0fe699 /vm_method.c
parenta985695b9e7f58552cfa6b8700c4dabc137e41e8 (diff)
Emit warning for other method redefinition types
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.
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c2
1 files changed, 1 insertions, 1 deletions
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));
}
}