From: "yui-knk (Kaneko Yuichiro) via ruby-core" <ruby-core@ml.ruby-lang.org>
To: ruby-core@ml.ruby-lang.org
Cc: "yui-knk (Kaneko Yuichiro)" <noreply@ruby-lang.org>
Subject: [ruby-core:123151] [Ruby Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
Date: Mon, 01 Sep 2025 03:30:55 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-114483.20250901033054.31364@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-18878.20220626130635.31364@ruby-lang.org
Issue #18878 has been updated by yui-knk (Kaneko Yuichiro).
Note: 9930363aab6ac4b8d7034baff85cd86c17953dc9 was the commit to allow `Foo::Bar {}` in parse.y.
----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-114483
* Author: qnighy (Masaki Hara)
* Status: Assigned
* Assignee: ydah (Yudai Takada)
* ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The following source doesn't parse:
```ruby
Foo::Bar {}
```
despite the following:
```ruby
bar # local variable or method call
Bar # constant
bar() # method call
Bar() # method call
bar {} # method call
Bar {} # method call
bar() {} # method call
Bar() {} # method call
Foo::bar # method call
Foo::Bar # constant
Foo::bar() # method call
Foo::Bar() # method call
Foo::bar {} # method call
# Foo::Bar {} # SyntaxError
Foo::bar() {} # method call
Foo::Bar() {} # method call
```
Especially considering `Bar {}`, this looks like a missing implementation rather than an intentional behavior.
--
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/
next prev parent reply other threads:[~2025-09-01 3:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
2022-06-27 16:48 ` [ruby-core:109074] " lhmzhou (Linda Zhou)
2022-06-28 3:38 ` [ruby-core:109076] " qnighy (Masaki Hara)
2023-08-30 20:26 ` [ruby-core:114598] " jeremyevans0 (Jeremy Evans) via ruby-core
2025-03-21 4:46 ` [ruby-core:121420] [Ruby " qnighy (Masaki Hara) via ruby-core
2025-05-07 6:07 ` [ruby-core:121872] " mame (Yusuke Endoh) via ruby-core
2025-08-27 14:38 ` [ruby-core:123086] " yui-knk (Kaneko Yuichiro) via ruby-core
2025-09-01 1:44 ` [ruby-core:123150] " yui-knk (Kaneko Yuichiro) via ruby-core
2025-09-01 3:30 ` yui-knk (Kaneko Yuichiro) via ruby-core [this message]
2025-11-13 3:39 ` [ruby-core:123781] " yui-knk (Kaneko Yuichiro) via ruby-core
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-114483.20250901033054.31364@ruby-lang.org \
--to=ruby-core@ml.ruby-lang.org \
--cc=noreply@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).