Project

General

Profile

Bug #11964

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

With Ruby 2.3, instead of following snippet printing bar (as it does with ruby 2.2.4) it prints foo.  
 If the methods are defined within the class instead of an included module, the snippet prints bar. 

 ~~~ruby ~~~ 
 module Mod 
   def foo 
     __callee__ 
   end 
   alias_method :bar, :foo 
 end 

 class Klass 
   include Mod 
 end 

 a = Klass.new 
 p a.bar 
 ~~~ 


 This appears to be the behavior for both 2.3.0 and ruby 2.3.0dev (2015-11-12 trunk 52550) [x86_64-linux]

Back