[ruby-dev:49131] [Ruby trunk - Bug #11296] Proc#arity returns weird value for non-lambda proc with optional arguments

From: zn@...
Date: 2015-06-23 13:26:23 UTC
List: ruby-dev #49131
Issue #11296 has been updated by Kazuhiro NISHIYAMA.


I think #5694 and #7765 are related issues.

----------------------------------------
Bug #11296: Proc#arity returns weird value for non-lambda proc with optional arguments
https://bugs.ruby-lang.org/issues/11296#change-53090

* Author: Yukihiro Matsumoto
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
`Proc.new(x=0){}.arity` returns 0, not -1 unlike lambdas.
I don't remember if it's intentional or not.  Anyone remember?

Matz.




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

In This Thread

Prev Next