Skip to content

Commit 44a2576

Browse files
committed
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
1 parent 46454b5 commit 44a2576

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ with all sufficient information, see the ChangeLog file or Redmine
1414

1515
=== Language changes
1616

17+
* Top-level constant look-up is removed. [Feature #11547]
18+
1719
=== Core classes updates (outstanding ones only)
1820

1921
=== Stdlib updates (outstanding ones only)

variable.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,8 +2273,12 @@ rb_const_search(VALUE klass, ID id, int exclude, int recurse, int visibility)
22732273
continue;
22742274
}
22752275
if (exclude && tmp == rb_cObject && klass != rb_cObject) {
2276+
#if 0
22762277
rb_warn("toplevel constant %"PRIsVALUE" referenced by %"PRIsVALUE"::%"PRIsVALUE"",
22772278
QUOTE_ID(id), rb_class_name(klass), QUOTE_ID(id));
2279+
#else
2280+
return Qundef;
2281+
#endif
22782282
}
22792283
return value;
22802284
}

0 commit comments

Comments
 (0)