diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-17 22:43:35 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-17 22:43:35 +0000 |
commit | 0c659e26cb8839dec8eb2559a8c7ff98a56c4e88 (patch) | |
tree | 178300a472960f60ed58648893d5d49861ef449c /test/ruby/test_module.rb | |
parent | ea4b4d3a769fb71cde1085c9652efa57b7596170 (diff) |
* vm.c (rb_vm_check_redefinition_opt_method): should check the real
class instead of the origin iclass.
[ruby-core:72188] [Bug #11826]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_module.rb')
-rw-r--r-- | test/ruby/test_module.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 5356983135..1a852f84a0 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1695,6 +1695,22 @@ class TestModule < Test::Unit::TestCase assert_equal(0, 1 / 2) end + def test_redefine_optmethod_after_prepend + bug11826 = '[ruby-core:72188] [Bug #11826]' + assert_separately [], %{ + module M + end + class Fixnum + prepend M + def /(other) + quo(other) + end + end + assert_equal(1 / 2r, 1 / 2, "#{bug11826}") + }, ignore_stderr: true + assert_equal(0, 1 / 2) + end + def test_prepend_visibility bug8005 = '[ruby-core:53106] [Bug #8005]' c = Class.new do |