Project

General

Profile

Actions

Bug #9721

closed

super: no superclass method in Ruby 2.1.1

Added by wehu (Wei Hu) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]
[ruby-core:61936]

Description

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.

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

Related issues 1 (0 open1 closed)

Copied to Ruby master - Bug #9740: super: no superclass method in Ruby 2.1.1Closed04/10/2014Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0