Project

General

Profile

Actions

Bug #14639

closed

Array#map and lambda arity regression

Added by lenwood (Paul Martensen) over 6 years ago. Updated about 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:86362]

Description

From ruby 2.4.1 onward the following script breaks (ArgumentError):

print_three = ->(a, b, c) { puts [a, b, c] }
arr = [[1, 2, 3]]

arr.map(&print_three)

This now requires explicit destructuring:

print_three = ->((a, b, c)) { puts [a, b, c] }

I guess this comes from a change in enum.c (line 45) from #9605 which seems to be similar.

While digging around I found https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/48193/diff that seems to address this very issue but I'm not sure.

If this is expected behavior feel free to disregard this.

First time posting to ruby trunk so I'm sorry If there is any Information missing.


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #15285: lambda return behavior regression from #14639ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0