From: Motohiro KOSAKI Date: 2011-07-10T15:18:56+09:00 Subject: [ruby-core:37957] [Ruby 1.9 - Bug #3422] Object.const_get(:A, false) can access BasicObject::A Issue #3422 has been updated by Motohiro KOSAKI. >Oh sorry, it must be: > >module LangModuleSpecInObject > module LangModuleTop > end >end >include LangModuleSpecInObject >module LangModuleTop >end >p LangModuleSpecInObject::LangModuleTop == LangModuleTop matz, could you please answer to Yui? ---------------------------------------- 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