Project

General

Profile

Actions

Bug #18878

open

parse.y: Foo::Bar {} is inconsistently rejected

Added by qnighy (Masaki Hara) over 2 years ago. Updated about 1 year ago.

Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
[ruby-core:109052]

Description

The following source doesn't parse:

Foo::Bar {}

despite the following:

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0