* [ruby-core:124888] [Ruby Bug#21927] Prism: misleading error message for forwarding in lambda argument
@ 2026-02-27 4:06 nobu (Nobuyoshi Nakada) via ruby-core
2026-02-27 11:08 ` [ruby-core:124890] " Earlopain (Earlopain _) via ruby-core
0 siblings, 1 reply; 2+ messages in thread
From: nobu (Nobuyoshi Nakada) via ruby-core @ 2026-02-27 4:06 UTC (permalink / raw)
To: ruby-core; +Cc: nobu (Nobuyoshi Nakada)
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/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* [ruby-core:124890] [Ruby Bug#21927] Prism: misleading error message for forwarding in lambda argument
2026-02-27 4:06 [ruby-core:124888] [Ruby Bug#21927] Prism: misleading error message for forwarding in lambda argument nobu (Nobuyoshi Nakada) via ruby-core
@ 2026-02-27 11:08 ` Earlopain (Earlopain _) via ruby-core
0 siblings, 0 replies; 2+ messages in thread
From: Earlopain (Earlopain _) via ruby-core @ 2026-02-27 11:08 UTC (permalink / raw)
To: ruby-core; +Cc: Earlopain (Earlopain _)
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/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-27 11:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-27 4:06 [ruby-core:124888] [Ruby Bug#21927] Prism: misleading error message for forwarding in lambda argument nobu (Nobuyoshi Nakada) via ruby-core
2026-02-27 11:08 ` [ruby-core:124890] " Earlopain (Earlopain _) via ruby-core
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).