[ruby-core:118269] [Ruby master Bug#20570] Nokey behavior changed since 3.3.

Issue #20570 has been reported by ksss (Yuki Kurihara). ---------------------------------------- Bug #20570: Nokey behavior changed since 3.3. https://bugs.ruby-lang.org/issues/20570 * Author: ksss (Yuki Kurihara) * Status: Open * ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin22] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I am using code that transfers the following method call, but found that the behavior has changed since CRuby 3.3. ```ruby receiver_value = Set.new method_name = :merge args = [1] kwargs = {} block = nil receiver_value.__send__(method_name, *args, **kwargs, &block) # => no keywords accepted (ArgumentError) ``` Upon investigation, I found that the behavior of calling a method using `**nil` has changed starting from version 3.3. ``` $ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'def foo(*, **nil); end; p foo(*[], **{})' WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ruby-2.6.0 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ... ruby-2.6.10 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview1 -e:1: syntax error, unexpected `nil', expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview2 nil ... ruby-3.2.4 nil ruby-3.3.0-preview1 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ... ruby-3.3.2 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ruby-3.4.0-preview1 -e:1:in '<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ``` Is this change intentional? -- https://bugs.ruby-lang.org/

Issue #20570 has been updated by ksss (Yuki Kurihara). Real case https://github.com/ksss/raap/blob/fff046c98c971da48df9106d8c698fbe40daaa57/l... ---------------------------------------- Bug #20570: Nokey behavior changed since 3.3. https://bugs.ruby-lang.org/issues/20570#change-108765 * Author: ksss (Yuki Kurihara) * Status: Open * ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin22] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I am using code that transfers the following method call, but found that the behavior has changed since CRuby 3.3. ```ruby receiver_value = Set.new method_name = :merge args = [1] kwargs = {} block = nil receiver_value.__send__(method_name, *args, **kwargs, &block) # => no keywords accepted (ArgumentError) ``` Upon investigation, I found that the behavior of calling a method using `**nil` has changed starting from version 3.3. ``` $ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'def foo(*, **nil); end; p foo(*[], **{})' WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ruby-2.6.0 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ... ruby-2.6.10 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview1 -e:1: syntax error, unexpected `nil', expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview2 nil ... ruby-3.2.4 nil ruby-3.3.0-preview1 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ... ruby-3.3.2 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ruby-3.4.0-preview1 -e:1:in '<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ``` Is this change intentional? -- https://bugs.ruby-lang.org/

Issue #20570 has been updated by austin (Austin Ziegler). I believe you’re *defining* with `**nil`, not *calling* with `**nil`. Your test should probably be `def foo(*, **); end; p foo(*[], **nil)`. This does seem to be a bit of a regression for your particular use case. ---------------------------------------- Bug #20570: Nokey behavior changed since 3.3. https://bugs.ruby-lang.org/issues/20570#change-108766 * Author: ksss (Yuki Kurihara) * Status: Open * ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin22] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I am using code that transfers the following method call, but found that the behavior has changed since CRuby 3.3. ```ruby receiver_value = Set.new method_name = :merge args = [1] kwargs = {} block = nil receiver_value.__send__(method_name, *args, **kwargs, &block) # => no keywords accepted (ArgumentError) ``` Upon investigation, I found that the behavior of calling a method using `**nil` has changed starting from version 3.3. ``` $ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'def foo(*, **nil); end; p foo(*[], **{})' WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ruby-2.6.0 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ... ruby-2.6.10 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview1 -e:1: syntax error, unexpected `nil', expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview2 nil ... ruby-3.2.4 nil ruby-3.3.0-preview1 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ... ruby-3.3.2 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ruby-3.4.0-preview1 -e:1:in '<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ``` Is this change intentional? -- https://bugs.ruby-lang.org/

Issue #20570 has been updated by mame (Yusuke Endoh). Status changed from Open to Assigned Assignee set to ko1 (Koichi Sasada) The following example is easy to understand this issue: ```ruby def foo(*, **nil); :ok; end foo(1, **{}) #=> Ruby 3.2: :ok #=> Ruby 3.3: :ok foo(*[1], **{}) #=> Ruby 3.2: :ok #=> Ruby 3.3: no keywords accepted (ArgumentError) ``` It's an obvious regression. Accoding to git bisect, the behavior has changed with commit:e87d0882910001ef3b0c2ccd43bf00cee8c34a0c. @ko1 Could you take a look? ---------------------------------------- Bug #20570: Nokey behavior changed since 3.3. https://bugs.ruby-lang.org/issues/20570#change-108767 * Author: ksss (Yuki Kurihara) * Status: Assigned * Assignee: ko1 (Koichi Sasada) * ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin22] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- I am using code that transfers the following method call, but found that the behavior has changed since CRuby 3.3. ```ruby receiver_value = Set.new method_name = :merge args = [1] kwargs = {} block = nil receiver_value.__send__(method_name, *args, **kwargs, &block) # => no keywords accepted (ArgumentError) ``` Upon investigation, I found that the behavior of calling a method using `**nil` has changed starting from version 3.3. ``` $ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'def foo(*, **nil); end; p foo(*[], **{})' WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ruby-2.6.0 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ... ruby-2.6.10 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview1 -e:1: syntax error, unexpected `nil', expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview2 nil ... ruby-3.2.4 nil ruby-3.3.0-preview1 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ... ruby-3.3.2 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ruby-3.4.0-preview1 -e:1:in '<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ``` Is this change intentional? -- https://bugs.ruby-lang.org/

Issue #20570 has been updated by ko1 (Koichi Sasada). solved on master with: https://github.com/ruby/ruby/commit/fc33559c40e08e4ae0a98821a679abddc4bb247c ---------------------------------------- Bug #20570: Nokey behavior changed since 3.3. https://bugs.ruby-lang.org/issues/20570#change-108820 * Author: ksss (Yuki Kurihara) * Status: Assigned * Assignee: ko1 (Koichi Sasada) * ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin22] * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED ---------------------------------------- I am using code that transfers the following method call, but found that the behavior has changed since CRuby 3.3. ```ruby receiver_value = Set.new method_name = :merge args = [1] kwargs = {} block = nil receiver_value.__send__(method_name, *args, **kwargs, &block) # => no keywords accepted (ArgumentError) ``` Upon investigation, I found that the behavior of calling a method using `**nil` has changed starting from version 3.3. ``` $ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'def foo(*, **nil); end; p foo(*[], **{})' WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ruby-2.6.0 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ... ruby-2.6.10 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview1 -e:1: syntax error, unexpected `nil', expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview2 nil ... ruby-3.2.4 nil ruby-3.3.0-preview1 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ... ruby-3.3.2 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ruby-3.4.0-preview1 -e:1:in '<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ``` Is this change intentional? -- https://bugs.ruby-lang.org/

Issue #20570 has been updated by k0kubun (Takashi Kokubun). The patch doesn't apply to Ruby 3.3 cleanly. Could anybody file a backport PR to `ruby_3_3` branch? ---------------------------------------- Bug #20570: Nokey behavior changed since 3.3. https://bugs.ruby-lang.org/issues/20570#change-109020 * Author: ksss (Yuki Kurihara) * Status: Closed * Assignee: ko1 (Koichi Sasada) * ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin22] * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED ---------------------------------------- I am using code that transfers the following method call, but found that the behavior has changed since CRuby 3.3. ```ruby receiver_value = Set.new method_name = :merge args = [1] kwargs = {} block = nil receiver_value.__send__(method_name, *args, **kwargs, &block) # => no keywords accepted (ArgumentError) ``` Upon investigation, I found that the behavior of calling a method using `**nil` has changed starting from version 3.3. ``` $ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'def foo(*, **nil); end; p foo(*[], **{})' WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ruby-2.6.0 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ... ruby-2.6.10 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview1 -e:1: syntax error, unexpected `nil', expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview2 nil ... ruby-3.2.4 nil ruby-3.3.0-preview1 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ... ruby-3.3.2 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ruby-3.4.0-preview1 -e:1:in '<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ``` Is this change intentional? -- https://bugs.ruby-lang.org/

Issue #20570 has been updated by k0kubun (Takashi Kokubun). I _think_ I managed to fix the conflict. I'd appreciate a backport PR next time though. ---------------------------------------- Bug #20570: Nokey behavior changed since 3.3. https://bugs.ruby-lang.org/issues/20570#change-109030 * Author: ksss (Yuki Kurihara) * Status: Closed * Assignee: ko1 (Koichi Sasada) * ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin22] * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED ---------------------------------------- I am using code that transfers the following method call, but found that the behavior has changed since CRuby 3.3. ```ruby receiver_value = Set.new method_name = :merge args = [1] kwargs = {} block = nil receiver_value.__send__(method_name, *args, **kwargs, &block) # => no keywords accepted (ArgumentError) ``` Upon investigation, I found that the behavior of calling a method using `**nil` has changed starting from version 3.3. ``` $ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'def foo(*, **nil); end; p foo(*[], **{})' WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ruby-2.6.0 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ... ruby-2.6.10 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview1 -e:1: syntax error, unexpected `nil', expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview2 nil ... ruby-3.2.4 nil ruby-3.3.0-preview1 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ... ruby-3.3.2 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ruby-3.4.0-preview1 -e:1:in '<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ``` Is this change intentional? -- https://bugs.ruby-lang.org/

Issue #20570 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ruby_3_3 commit:17e21d815583ef7d6be03f29e90a219602497626 merged revision(s) commit:fc33559c. ---------------------------------------- Bug #20570: Nokey behavior changed since 3.3. https://bugs.ruby-lang.org/issues/20570#change-109031 * Author: ksss (Yuki Kurihara) * Status: Closed * Assignee: ko1 (Koichi Sasada) * ruby -v: ruby 3.3.2 (2024-05-30 revision e5a195edf6) [arm64-darwin22] * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE ---------------------------------------- I am using code that transfers the following method call, but found that the behavior has changed since CRuby 3.3. ```ruby receiver_value = Set.new method_name = :merge args = [1] kwargs = {} block = nil receiver_value.__send__(method_name, *args, **kwargs, &block) # => no keywords accepted (ArgumentError) ``` Upon investigation, I found that the behavior of calling a method using `**nil` has changed starting from version 3.3. ``` $ docker run -it --rm rubylang/all-ruby env ALL_RUBY_SINCE=ruby-2.6 ./all-ruby -e 'def foo(*, **nil); end; p foo(*[], **{})' WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested ruby-2.6.0 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ... ruby-2.6.10 -e:1: syntax error, unexpected nil, expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview1 -e:1: syntax error, unexpected `nil', expecting ')' def foo(*, **nil); end; p foo(*[], **{}) ^~~ exit 1 ruby-2.7.0-preview2 nil ... ruby-3.2.4 nil ruby-3.3.0-preview1 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ... ruby-3.3.2 -e:1:in `<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ruby-3.4.0-preview1 -e:1:in '<main>': no keywords accepted (ArgumentError) def foo(*, **nil); end; p foo(*[], **{}) ^^^^^^^^^ exit 1 ``` Is this change intentional? -- https://bugs.ruby-lang.org/
participants (5)
-
austin (Austin Ziegler)
-
k0kubun (Takashi Kokubun)
-
ko1 (Koichi Sasada)
-
ksss (Yuki Kurihara)
-
mame (Yusuke Endoh)