* class.c (class_instance_method_list): consider prepended Class/Module

when recur != 0. [ruby-dev:45863] [Bug #6660]

* test/ruby/test_module.rb (test_prepend_instance_methods_false): add
  a test for it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2012-06-28 00:39:52 +00:00
parent a4932b54b5
commit 912df4b615
3 changed files with 22 additions and 2 deletions

View file

@ -1327,4 +1327,10 @@ class TestModule < Test::Unit::TestCase
class_eval(&block) if block
end
end
def test_prepend_instance_methods_false
bug6660 = '[ruby-dev:45863]'
assert_equal([:m1], Class.new{ prepend Module.new; def m1; end }.instance_methods(false), bug6660)
assert_equal([:m1], Class.new(Class.new{def m2;end}){ prepend Module.new; def m1; end }.instance_methods(false), bug6660)
end
end