Issue #9721 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r45565.

----------
proc.c: fix super in bound UnboundMethod

* proc.c (rb_method_call_with_block, umethod_bind): call with
  IClass including the module for a module instance method.
  [ruby-core:61936] [Bug #9721]
* vm_insnhelper.c (vm_search_super_method): allow bound
  UnboundMethod case.

----------------------------------------
Bug #9721: super: no superclass method in Ruby 2.1.1
https://bugs.ruby-lang.org/issues/9721#change-46153

* Author: Wei Hu
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: current: 2.2.0
* ruby -v: ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
Below code will result into error:

~~~
super: no superclass method `foo' for #<Object:0x002b0430670fe8>
~~~

However, it can pass with Ruby 1.9 and I am not sure if it's feature changes or bug.

~~~ruby
module A
  def foo
    puts "A"
  end
end
 
module B
  def foo
    puts "B"
    super
  end
  ub_meth = instance_method :foo
  define_method :foo do
    ub_meth.bind(self).call()
  end
end
a = Object.new
a.extend A
a.extend B
a.foo
~~~




-- 
https://bugs.ruby-lang.org/