Project

General

Profile

Actions

Bug #19983

closed

Nested `*` seems incorrect

Added by Eregon (Benoit Daloze) about 1 year ago. Updated 11 months ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.3.0dev (2023-10-30T09:27:06Z master 14fa5e39d7) [x86_64-linux]
[ruby-core:115212]

Description

$ ruby -v -e 'def m(*); ->(*) { p(*) }; end; m(1).call(2)'  
ruby 3.3.0dev (2023-10-30T09:27:06Z master 14fa5e39d7) [x86_64-linux]
1

But I would expect 2.

Much like:

$ ruby -e 'def m(a); ->(a) { p(a) }; end; m(1).call(2)'
ruby 3.3.0dev (2023-10-30T09:27:06Z master 14fa5e39d7) [x86_64-linux]
2

i.e. the inner variable should win.

Also affects at least 3.2.


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #19370: Anonymous parameters for blocks?Closedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like1Like0Like0Like0