[ruby-core:124888] [Ruby Bug#21927] Prism: misleading error message for forwarding in lambda argument
Issue #21927 has been reported by nobu (Nobuyoshi Nakada). ---------------------------------------- Bug #21927: Prism: misleading error message for forwarding in lambda argument https://bugs.ruby-lang.org/issues/21927 * Author: nobu (Nobuyoshi Nakada) * Status: Open * Assignee: prism * ruby -v: d256629bf9 * Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- Even in a forwarding method: ```console $ ruby --parser=prism -e 'def m(...) ->(...){}; end' -e: -e:1: syntax error found (SyntaxError)
1 | def m(...) ->(...){}; end | ^~~ unexpected ... when the parent method is not forwarding
This message is proper for method arguments:
```console
$ ruby --parser=prism -e 'def m() p(...); end'
-e: -e:1: syntax error found (SyntaxError)
> 1 | def m() p(...); end
| ^~~ unexpected ... when the parent method is not forwarding
The message from parse.y is different; "unexpected ... in lambda argument": ```console $ ruby --parser=parse.y -e 'def m(...) ->(...){}; end' -e:1: unexpected ... in lambda argument def m(...) ->(...){}; end ruby: compile error (SyntaxError) ``` -- https://bugs.ruby-lang.org/
Issue #21927 has been updated by Earlopain (Earlopain _). https://github.com/ruby/prism/pull/3947 ---------------------------------------- Bug #21927: Prism: misleading error message for forwarding in lambda argument https://bugs.ruby-lang.org/issues/21927#change-116549 * Author: nobu (Nobuyoshi Nakada) * Status: Open * Assignee: prism * ruby -v: d256629bf9 * Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- Even in a forwarding method: ```console $ ruby --parser=prism -e 'def m(...) ->(...){}; end' -e: -e:1: syntax error found (SyntaxError)
1 | def m(...) ->(...){}; end | ^~~ unexpected ... when the parent method is not forwarding
This message is proper for method arguments:
```console
$ ruby --parser=prism -e 'def m() p(...); end'
-e: -e:1: syntax error found (SyntaxError)
> 1 | def m() p(...); end
| ^~~ unexpected ... when the parent method is not forwarding
The message from parse.y is different; "unexpected ... in lambda argument": ```console $ ruby --parser=parse.y -e 'def m(...) ->(...){}; end' -e:1: unexpected ... in lambda argument def m(...) ->(...){}; end ruby: compile error (SyntaxError) ``` -- https://bugs.ruby-lang.org/
Issue #21927 has been updated by k0kubun (Takashi Kokubun). Backport changed from 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED, 4.0: REQUIRED to 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED, 4.0: DONE ruby_4_0 commit:e7d2828fb677874fb425e6129e0c4c20acc0e1dd. ---------------------------------------- Bug #21927: Prism: misleading error message for forwarding in lambda argument https://bugs.ruby-lang.org/issues/21927#change-116719 * Author: nobu (Nobuyoshi Nakada) * Status: Closed * Assignee: prism * ruby -v: d256629bf9 * Backport: 3.2: DONTNEED, 3.3: DONTNEED, 3.4: REQUIRED, 4.0: DONE ---------------------------------------- Even in a forwarding method: ```console $ ruby --parser=prism -e 'def m(...) ->(...){}; end' -e: -e:1: syntax error found (SyntaxError)
1 | def m(...) ->(...){}; end | ^~~ unexpected ... when the parent method is not forwarding
This message is proper for method arguments:
```console
$ ruby --parser=prism -e 'def m() p(...); end'
-e: -e:1: syntax error found (SyntaxError)
> 1 | def m() p(...); end
| ^~~ unexpected ... when the parent method is not forwarding
The message from parse.y is different; "unexpected ... in lambda argument": ```console $ ruby --parser=parse.y -e 'def m(...) ->(...){}; end' -e:1: unexpected ... in lambda argument def m(...) ->(...){}; end ruby: compile error (SyntaxError) ``` -- https://bugs.ruby-lang.org/
participants (3)
-
Earlopain (Earlopain _) -
k0kubun (Takashi Kokubun) -
nobu (Nobuyoshi Nakada)