Project

General

Profile

Actions

Bug #5694

closed

Proc#arity doesn't take optional arguments into account.

Added by marcandre (Marc-Andre Lafortune) almost 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
-
Backport:
[ruby-core:41431]

Description

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.


Related issues

Related to Ruby master - Bug #6039: lambda vs proc; #to_ary w/ splat bugRejectedmatz (Yukihiro Matsumoto)02/17/2012Actions
Blocks Ruby master - Bug #5746: Proc#curry too strict about lambda's arity.Closedmarcandre (Marc-Andre Lafortune)12/12/2011Actions
Actions

Also available in: Atom PDF