
Issue #19983 has been updated by zverok (Victor Shepelev). Procs don't support anonymous arguments (e.g. to pass them further), see #19370. ```ruby ->(*) { p(*) }.call(1) # no anonymous rest parameter (SyntaxError) ``` So, the code is equivalent to ```ruby def m(*); ->(_) { p(*) }; end; m(1).call(2) ``` So, the `*` refers to the method's parameters. (Unless I am missing something and support was added into 3.3) ---------------------------------------- Bug #19983: Nested * seems incorrect https://bugs.ruby-lang.org/issues/19983#change-105129 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-10-30T09:27:06Z master 14fa5e39d7) [x86_64-linux] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- ``` $ 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. -- https://bugs.ruby-lang.org/