* vm_insnhelper.c (vm_search_const_defined_class): search

ancestors only when global scope.  [ruby-core:39227] [Bug #5264]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-09-02 05:36:49 +00:00
parent 5e14b97947
commit 7dddaf6807
4 changed files with 38 additions and 22 deletions

View file

@ -548,15 +548,25 @@ class TestModule < Test::Unit::TestCase
def test_const_in_module
bug3423 = '[ruby-core:37698]'
assert_in_out_err([], <<-INPUT, %w[ok], [], bug3423)
module LangModuleSpecInObject
module LangModuleTop
end
end
include LangModuleSpecInObject
module LangModuleTop
end
puts "ok" if LangModuleSpecInObject::LangModuleTop == LangModuleTop
INPUT
module LangModuleSpecInObject
module LangModuleTop
end
end
include LangModuleSpecInObject
module LangModuleTop
end
puts "ok" if LangModuleSpecInObject::LangModuleTop == LangModuleTop
INPUT
bug5264 = '[ruby-core:39227]'
assert_in_out_err([], <<-'INPUT', [], [], bug5264)
class A
class X; end
end
class B < A
module X; end
end
INPUT
end
def test_class_variable_get