From: Eric Hodel Date: 2012-03-15T07:23:18+09:00 Subject: [ruby-core:43286] [ruby-trunk - Bug #6000] respond_to? check in check_funcall() does not work with single-argument respond_to? Issue #6000 has been updated by Eric Hodel. ruby -v set to - =begin Fixed by r35025 I was depending upon vm_call0() to perform arity checking, but it does not, so r35025 does it by hand. Existing ruby libraries have (({def respond_to? method})). Before r34564 ruby trunk called respond_to? with two arguments, the method and a boolean to include private methods, which broke backwards compatibility. This bug is about allowing respond_to? implementations from ruby 1.8 and ruby 1.9 to continue to work. =end ---------------------------------------- Bug #6000: respond_to? check in check_funcall() does not work with single-argument respond_to? https://bugs.ruby-lang.org/issues/6000#change-24587 Author: Eric Hodel Status: Assigned Priority: Normal Assignee: Eric Hodel Category: Target version: ruby -v: - =begin The following code works in Ruby 1.9.3: class C def respond_to? name super name end end [C.new].flatten But fails with ArgumentError after r32855: $ ruby20 -v test.rb ruby 2.0.0dev (2012-02-11 trunk 34547) [x86_64-darwin11.2.0] test.rb:2:in `respond_to?': wrong number of arguments (2 for 1) (ArgumentError) from test.rb:7:in `flatten' from test.rb:7:in `
' I think this should still work to support legacy 1.9 applications in 2.0 =end -- http://bugs.ruby-lang.org/