Project

General

Profile

Actions

Bug #16748

closed

Different behaviour between a hash and multi-Array when passing 2 arguments to a proc

Bug #16748: Different behaviour between a hash and multi-Array when passing 2 arguments to a proc

Added by Mattruby (Matthew Nash) over 5 years ago. Updated over 5 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:97660]

Description

In Ruby 2.5.5 i get what i'm expecting

test = -> (one, two) { one }
[['one', 'two']].map(&test)
=> ["one"]

In Ruby 2.7.0 this doesn't work

test = -> (one, two) { one }
[['one', 'two']].map(&test)
wrong number of arguments (given 1, expected 2) (ArgumentError)

Files

Screen Shot 2020-04-01 at 16.47.37.png (205 KB) Screen Shot 2020-04-01 at 16.47.37.png Mattruby (Matthew Nash), 04/01/2020 03:48 PM
Actions

Also available in: PDF Atom