From: "nagachika (Tomoyuki Chikanaga) via ruby-core" Date: 2024-07-20T12:52:14+00:00 Subject: [ruby-core:118650] [Ruby master Bug#20062] Numbered parameters are broken in Ruby 3.3-dev Issue #20062 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED to 3.1: DONTNEED, 3.2: DONTNEED I believe this issue is not the case on ruby_3_2. The test case added was passed with current ruby_3_2 branch. ---------------------------------------- Bug #20062: Numbered parameters are broken in Ruby 3.3-dev https://bugs.ruby-lang.org/issues/20062#change-109178 * Author: osyo (manga osyo) * Status: Closed * Assignee: nobu (Nobuyoshi Nakada) * Target version: 3.3 * ruby -v: ruby 3.3.0dev (2023-12-13T13:16:11Z master f390c51b15) [x86_64-linux] * Backport: 3.1: DONTNEED, 3.2: DONTNEED ---------------------------------------- Define Numbered parameters and a method in one block and then reference Numbered parameters in another block, you will get a SyntaxError in Ruby 3.3. This is not a problem in Ruby 3.2. ```ruby 'a'.tap do p _1 def f1; end end 'a'.tap do p _1 end __END__ output: Ruby 3.2.2 => "a" "a" Ruby 3.3.0dev(2023-12-13T13:16:11Z master f390c51b15) => /path/to/test.rb: /path/to/test.rb:8: numbered parameter is already used in (SyntaxError) /path/to/test.rb:2: outer block here ``` I noticed this while checking the operation of https://bugs.ruby-lang.org/issues/18966. I haven't checked, but https://bugs.ruby-lang.org/issues/19619 may be related. -- 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/lists/ruby-core.ml.ruby-lang.org/