From: Thomas Sawyer Date: 2011-07-04T09:07:20+09:00 Subject: [ruby-core:37762] [Ruby 1.9 - Bug #3768] Constant Lookup doesn't work in a subclass of BasicObject Issue #3768 has been updated by Thomas Sawyer. I am not sure that a fix is such a huge change. Look-up can be delegated: class BasicObject def self.const_missing(name) ::Object.const_get(name) end end But yes, I think the ultimate fix does need a rework for constant lookup to terminate at toplevel instead of Object, but I can understand that's a "Ruby 2.0" kind of change. But the above may suffice in the mean time, if it doesn't present any unintended consequences (I can't think of any myself). ---------------------------------------- Bug #3768: Constant Lookup doesn't work in a subclass of BasicObject http://redmine.ruby-lang.org/issues/3768 Author: Thomas Sawyer Status: Rejected Priority: Normal Assignee: Yukihiro Matsumoto Category: lib Target version: ruby -v: 1.9.2-p0 =begin ruby-1.9.2-p0 > module M ruby-1.9.2-p0 ?> end => nil ruby-1.9.2-p0 > class X < BasicObject ruby-1.9.2-p0 ?> include M ruby-1.9.2-p0 ?> end NameError: uninitialized constant X::M from (irb):4:in `' from (irb):3 from /home/trans/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in `
' =end -- http://redmine.ruby-lang.org