Project

General

Profile

Bug #9721

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

Below code will result into error: 

 ~~~ 
 super: no superclass method `foo' for `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 
 ~~~ 

Back