summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-01 09:07:56 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-01 09:07:56 (GMT)
commit44a2576f798b07139adde2d279e48fdbe71a0148 (patch)
treed512e60fff6ca316ce529b20d7e79212ceacbf79 /variable.c
parent46454b5ee67cc198edc3b56ef2ecfdcf90fa83f8 (diff)
variable.c: top-level constant look-up
* variable.c (rb_const_search): [EXPERIMENTAL] remove top-level constant look-up. [Feature #11547] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57244 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 91482e9..70a28a6 100644
--- a/variable.c
+++ b/variable.c
@@ -2273,8 +2273,12 @@ rb_const_search(VALUE klass, ID id, int exclude, int recurse, int visibility)
continue;
}
if (exclude && tmp == rb_cObject && klass != rb_cObject) {
+#if 0
rb_warn("toplevel constant %"PRIsVALUE" referenced by %"PRIsVALUE"::%"PRIsVALUE"",
QUOTE_ID(id), rb_class_name(klass), QUOTE_ID(id));
+#else
+ return Qundef;
+#endif
}
return value;
}