From 4a1cfe70dc31f9be8a12908d85b51297d61b8eae Mon Sep 17 00:00:00 2001 From: mame Date: Sat, 3 Dec 2011 11:52:14 +0000 Subject: * variable.c (set_const_visibility): print a warning when no argument is passwd to Module#private_constant. [ruby-list:48558] * vm_method.c (set_method_visibility): ditto for Module#private_class_method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_method.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vm_method.c') diff --git a/vm_method.c b/vm_method.c index f1235dcd47..3811f48246 100644 --- a/vm_method.c +++ b/vm_method.c @@ -985,6 +985,11 @@ set_method_visibility(VALUE self, int argc, VALUE *argv, rb_method_flag_t ex) { int i; secure_visibility(self); + + if (argc == 0) { + rb_warning("%s with no argument is just ignored", rb_id2name(rb_frame_callee())); + } + for (i = 0; i < argc; i++) { VALUE v = argv[i]; ID id = rb_check_id(&v); -- cgit v1.2.3