Actions
Bug #20062
closedNumbered parameters are broken in Ruby 3.3-dev
ruby -v:
ruby 3.3.0dev (2023-12-13T13:16:11Z master f390c51b15) [x86_64-linux]
Backport:
Description
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.
'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.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like1Like0