Forum: Ruby-core Aliased methods change super logic when retrieved with Object#method

Posted by fahmisetiawan (Fahmi Setiawan) (Guest)
on 2012-10-01 13:37
(Received via mailing list)
Issue #1151 has been updated by fahmisetiawan (Fahmi Setiawan).


http://alkian.blogspot.com/2012/09/cara-menyembuhk...
http://alkian.blogspot.com/2012/09/keretamini-kere...
http://alkian.blogspot.com/2012/09/harga-spesifika...
http://alkian.blogspot.com/2012/09/download-one-pi...
http://alkian.blogspot.com/2012/09/harga-dan-spesi...
http://alkian.blogspot.com/2012/09/harga-dan-spesi...
http://alkian.blogspot.com/2012/09/download-harves...
http://alkian.blogspot.com/2012/09/download-gratis...
http://alkian.blogspot.com/2012/09/cara-download-d...
http://alkian.blogspot.com/2012/09/cara-mengganti-...
http://alkian.blogspot.com/2012/09/free-download-w...
http://alkian.blogspot.com/2012/09/free-download-k...
http://alkian.blogspot.com/2012/09/free-download-c...
http://alkian.blogspot.com/2012/09/cara-membuat-re...
http://alkian.blogspot.com/2012/09/daftar-harga-le...
http://alkian.blogspot.com/2012/09/download-theme-...
http://alkian.blogspot.com/2012/09/download-alqura...
http://alkian.blogspot.com/2012/09/kumpulan-kata-k...
http://alkian.blogspot.com/2012/09/kumpulan-websit...
http://alkian.blogspot.com/2012/09/template-seo-fr...
http://alkian.blogspot.com/2012/09/harga-hp-nokia-...
http://alkian.blogspot.com/2012/09/foto-ariel-noah...
http://alkian.blogspot.com/2012/09/download-serial...
http://alkian.blogspot.com/2012/09/biodata-foto-iq...
http://alkian.blogspot.com/2012/09/harga-dan-spesi...
http://alkian.blogspot.com/2012/09/biodata-akb48-l...
http://alkian.blogspot.com/2012/08/arti-dan-makna-...
----------------------------------------
Backport #1151: Aliased methods change super logic when retrieved with 
Object#method
https://bugs.ruby-lang.org/issues/1151#change-29907

Author: headius (Charles Nutter)
Status: Assigned
Priority: Normal
Assignee: wyhaines (Kirk Haines)
Category:
Target version:


=begin
 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
  end

  class Bar222 < Foo222
    def a; super; end
    alias b a
  end

  puts('a' == Bar222.new.b) # true
  puts('a' == Bar222.new.method(:b).call) # 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: 
http://jira.codehaus.org/browse/JRUBY-1192 and I reported it to 
ruby-core here: 
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/... and a 
patch was proposed here: 
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/.... Since 
it behaves as I expect in 1.9, I assume the 1.8.x behavior is incorrect.
=end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.