From e7a2c4251e98cd515d861facbba2fa86983dfb89 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 5 Feb 2014 13:41:03 +0000 Subject: merge revision(s) 44527,44552,44553: * vm_insnhelper.c (vm_search_super_method): when super called in a bound UnboundMethod generated from a module, no superclass is found since the current defined class is the module, then call method_missing in that case. [ruby-core:59619] [Bug #9377] * vm_insnhelper.c (vm_search_super_method): allow bound method from a module, yet another method transplanting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_super.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index c5f724ebb8..82d6e19ec4 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -440,4 +440,17 @@ class TestSuper < Test::Unit::TestCase assert_equal(:ok, o.method(:foo).call, bug9315) end end + + def test_missing_super_in_module_unbound_method + bug9377 = '[ruby-core:59619] [Bug #9377]' + + a = Module.new do + def foo; super end + end + + m = a.instance_method(:foo).bind(Object.new) + assert_raise(NoMethodError, bug9377) do + m.call + end + end end -- cgit v1.2.3