[ruby-core:109569] [Ruby master Bug#18966] Strange behavior when numbered parameters and method definition are both used in a block
From:
"tompng (tomoya ishida)" <noreply@...>
Date:
2022-08-19 08:51:28 UTC
List:
ruby-core #109569
Issue #18966 has been reported by tompng (tomoya ishida).
----------------------------------------
Bug #18966: Strange behavior when numbered parameters and method definition are both used in a block
https://bugs.ruby-lang.org/issues/18966
* Author: tompng (tomoya ishida)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.2.0dev (2022-08-19T04:20:20Z :detached: 17d0e5bee7) [x86_64-linux]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
~~~ruby
'a'.tap { p _1; def f()=42 } #=> "a"
'a'.tap { p _1; def f(a)=42 } #=> nil
'a'.tap { def f()=42; p _1 } #=> "a"
'a'.tap { def f(a)=42; p _1 } # Syntax Error -:1: ordinary parameter is defined
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>