Project

General

Profile

Backport #8367 » super-gone.rb

indirect (André Arko), 05/04/2013 10:20 AM

 
#!/usr/bin/env ruby

# This is a reproduction case for a bug that appeared in 2.0.0-p0, but is still present in trunk.
# In the bug, super should be defined inside a block passed to a method defined in a module that
# is extended to the object the method is called on, but it is not defined.

class C
def x; end
end

module M
def b; yield; end

def x
b do
# On 1.9.3, this is "super", but on 2.0.0 it is nil
p defined?(super)
end
end
end

c = C.new
c.extend M
c.x
    (1-1/1)