Issue #5694 has been updated by matz (Yukihiro Matsumoto).

Assignee changed from matz (Yukihiro Matsumoto) to nobu (Nobuyoshi Nakada)

Because non-lambda proc and lamdba behave differently.
You can blame me about inconsistency. I should have designed proc more consistently.
But I sometimes made mistakes and it's too late to fix this.
At least for 2.0.

Nobu, could you update r36411 according to our discussion?

Matz.

----------------------------------------
Bug #5694: Proc#arity doesn't take optional arguments into account. 
https://bugs.ruby-lang.org/issues/5694#change-28155

Author: marcandre (Marc-Andre Lafortune)
Status: Open
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: 
ruby -v: -


Currently:

    ->(foo = 42){}.arity # => 0, should be -1

This is contrary to the documentation and to what we should expect from the equivalent method definition.

Fixed in trunk, requesting backport for the 1.9 line.



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