Bug #918: super doesn't work correctly when used with define_method
http://redmine.ruby-lang.org/issues/show/918

Author: Tomas Matousek
Status: Open, Priority: Normal
Target version: 1.9.x

The following prints B,A in 1.8 but B,B,A in 1.9.*.
It seems that the receiver's class (C) is incorrectly used to determine the base class. The class where the target method (B#m) is defined (i.e. B) should be used so that A#m is invoked immediately.

class A
  def m
    puts 'A'
  end
end

class B < A
  define_method(:m) do    
    puts 'B'
    super()
  end
end

class C < B
end

C.new.m


----------------------------------------
http://redmine.ruby-lang.org