From: Yui NARUSE Date: 2011-07-01T05:29:27+09:00 Subject: [ruby-core:37698] [Ruby 1.9 - Bug #3422][Assigned] Object.const_get(:A, false) can access BasicObject::A Issue #3422 has been updated by Yui NARUSE. Status changed from Closed to Assigned Following code still doesn't work: module LangModuleSpecInObject module LangModuleTop end end include LangModuleSpecInObject p LangModuleTop end p LangModuleSpecInObject::LangModuleTop == LangModuleTop #=> false (it should be true) ---------------------------------------- Bug #3422: Object.const_get(:A, false) can access BasicObject::A http://redmine.ruby-lang.org/issues/3422 Author: Magnus Holm Status: Assigned Priority: Normal Assignee: Yukihiro Matsumoto Category: core Target version: 1.9.3 ruby -v: ruby 1.9.2dev (2010-05-31 revision 28117) [x86_64-darwin10.3.0] =begin From the documentation of Module#const_get(sym, inherit=true): If the constant is not defined or is defined by the ancestors and inherit is false, NameError will be raised. Yet, this works fine: BasicObject::A = 1 Object.const_get(:A, false) # => 1 While I haven't tested it, I believe the attached patch should fix the issue. =end -- http://redmine.ruby-lang.org