Project

General

Profile

Actions

Bug #5694

closed

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

Added by marcandre (Marc-Andre Lafortune) about 13 years ago. Updated over 12 years ago.

Status:
Closed
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 2 (0 open2 closed)

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

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0