summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-03 11:52:14 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-03 11:52:14 +0000
commit4a1cfe70dc31f9be8a12908d85b51297d61b8eae (patch)
tree3c183287e1549d284dff0c5a364153124befe680 /variable.c
parentd267b2e347b0ef226c132a881ed11a89e622df24 (diff)
* 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
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/variable.c b/variable.c
index fc912d64f8..7f8988c579 100644
--- a/variable.c
+++ b/variable.c
@@ -2111,6 +2111,10 @@ set_const_visibility(VALUE mod, int argc, VALUE *argv, rb_const_flag_t flag)
"Insecure: can't change constant visibility");
}
+ if (argc == 0) {
+ rb_warning("%s with no argument is just ignored", rb_id2name(rb_frame_callee()));
+ }
+
for (i = 0; i < argc; i++) {
VALUE val = argv[i];
id = rb_check_id(&val);