Skip to content

Commit

Permalink
variable.c: top-level constant look-up
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nobu committed Jan 1, 2017
1 parent 46454b5 commit 44a2576
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -14,6 +14,8 @@ with all sufficient information, see the ChangeLog file or Redmine


=== Language changes === Language changes


* Top-level constant look-up is removed. [Feature #11547]

=== Core classes updates (outstanding ones only) === Core classes updates (outstanding ones only)


=== Stdlib updates (outstanding ones only) === Stdlib updates (outstanding ones only)
Expand Down
4 changes: 4 additions & 0 deletions variable.c
Expand Up @@ -2273,8 +2273,12 @@ rb_const_search(VALUE klass, ID id, int exclude, int recurse, int visibility)
continue; continue;
} }
if (exclude && tmp == rb_cObject && klass != rb_cObject) { if (exclude && tmp == rb_cObject && klass != rb_cObject) {
#if 0
rb_warn("toplevel constant %"PRIsVALUE" referenced by %"PRIsVALUE"::%"PRIsVALUE"", rb_warn("toplevel constant %"PRIsVALUE" referenced by %"PRIsVALUE"::%"PRIsVALUE"",
QUOTE_ID(id), rb_class_name(klass), QUOTE_ID(id)); QUOTE_ID(id), rb_class_name(klass), QUOTE_ID(id));
#else
return Qundef;
#endif
} }
return value; return value;
} }
Expand Down

0 comments on commit 44a2576

Please sign in to comment.