Backport #1151

Updated by nagachika (Tomoyuki Chikanaga) almost 7 years ago

  This is a peculiar case I don't believe I've reported before. It seems that "method" can change the super behavior of an alias: 
   # Test weird likely-a-bug where method() will repurpose where super goes to 
   class Foo222 
     def a; 'a'; end 
     def b; 'b'; end 
   class Bar222 < Foo222 
     def a; super; end 
     alias b a 
   puts('a' == # true 
   puts('a' == # false 
  Ruby 1.9 behaves as you would expect, calling the "a" super method in both cases. We changed our behavior in JRuby 1.1.2 to match Ruby 1.8.6, but I still believe this is a bug. The JRuby bug report is here: and I reported it to ruby-core here: and a patch was proposed here: Since it behaves as I expect in 1.9, I assume the 1.8.x behavior is incorrect.