Project

General

Profile

Actions

Backport #6000

closed

respond_to? check in check_funcall() does not work with single-argument respond_to?

Added by drbrain (Eric Hodel) about 12 years ago. Updated about 12 years ago.

Status:
Closed
[ruby-core:42493]

Description

=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


Files

vm_eval.c.respond_to_arity.patch (1.33 KB) vm_eval.c.respond_to_arity.patch drbrain (Eric Hodel), 02/11/2012 09:02 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0