Nakada, Nobuyoshi
7/4/2005 2:54:00 AM
Hi,
At Mon, 4 Jul 2005 01:35:43 +0900,
_ugly wrote in [ruby-talk:147106]:
> Is my head broken or ruby -W broken? I'm thinking the former.
I think it's the latter, because it doesn't appear when
redefining undefined ordinary methods.
Index: eval.c
===================================================================
RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.796
diff -U2 -p -r1.796 eval.c
--- eval.c 2 Jul 2005 08:20:25 -0000 1.796
+++ eval.c 4 Jul 2005 02:32:14 -0000
@@ -3914,5 +3914,5 @@ rb_eval(self, n)
rb_raise(rb_eSecurityError, "redefining method prohibited");
}
- if (RTEST(ruby_verbose)) {
+ if (body && RTEST(ruby_verbose) && body->nd_cnt == 0 && body->nd_body) {
rb_warning("redefine %s", rb_id2name(node->nd_mid));
}
--
Nobu Nakada