[#51196] [Ruby master Bug#19132] `**` を引数に指定すると no anonymous keyword rest parameter になる — "tommy (Masahiro Tomita)" <noreply@...>

Issue #19132 has been reported by tommy (Masahiro Tomita).

7 messages 2022/11/16

[ruby-dev:51203] [Ruby master Feature#19134] ** is not allowed in def foo(...)

From: "shugo (Shugo Maeda)" <noreply@...>
Date: 2022-11-17 09:27:00 UTC
List: ruby-dev #51203
Issue #19134 has been reported by shugo (Shugo Maeda).

----------------------------------------
Feature #19134: ** is not allowed in def foo(...)
https://bugs.ruby-lang.org/issues/19134

* Author: shugo (Shugo Maeda)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
`*` and `&` are allowed in the body of a method with `...` argument forwarding, but `**` is not allowed.

```
def foo(...)
  bar(*) # OK
  baz(&) # OK
  quux(**) # NG
end
```

Is it intended behavior?

It seems that parse.y has code like `#ifdef RUBY3_KEYWORDS`, and if RUBY3_KEYWORDS, `**` will also be supported.




-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next