From: "jeremyevans0 (Jeremy Evans) via ruby-core" Date: 2024-01-11T21:46:12+00:00 Subject: [ruby-core:116177] [Ruby master Bug#19983] Nested `*` seems incorrect Issue #19983 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Open to Closed This was fixed in Ruby 3.3: ``` $ ruby -v -e 'def m(*); ->(*) { p(*) }; end; m(1).call(2)' ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-openbsd] -e:1: anonymous rest parameter is also used within block -e: compile error (SyntaxError) ``` ---------------------------------------- Bug #19983: Nested `*` seems incorrect https://bugs.ruby-lang.org/issues/19983#change-106192 * Author: Eregon (Benoit Daloze) * Status: Closed * Priority: Normal * ruby -v: ruby 3.3.0dev (2023-10-30T09:27:06Z master 14fa5e39d7) [x86_64-linux] * Backport: 3.0: DONTNEED, 3.1: DONTNEED, 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/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/