Issue #8072 has been updated by marcandre (Marc-Andre Lafortune).

Status changed from Closed to Open
Assignee changed from matz (Yukihiro Matsumoto) to naruse (Yui NARUSE)
Backport changed from 1.9.3: DONTNEED, 2.0.0: REQUIRED to 1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1.0: REQUIRED

I don't think this fix is correct. A method/proc having keyword arguments should be considered as having one optional argument, not infinitely many. Among other things:

	proc{|options = {}|}.arity == proc{|**options|}.arity # => should be true

I've committed r44432 to fix this.
----------------------------------------
Bug #8072: Method#arity for keyword arguments
https://bugs.ruby-lang.org/issues/8072#change-43899

Author: marcandre (Marc-Andre Lafortune)
Status: Open
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: core
Target version: current: 2.1.0
ruby -v: r39608
Backport: 1.9.3: DONTNEED, 2.0.0: REQUIRED, 2.1.0: REQUIRED


I would expect the following two methods to have the same arity:

    def old_way(req, options = {}); end
    def new_way(req, **options); end

    method(:new_way).arity # => 1, should be -2


-- 
http://bugs.ruby-lang.org/