ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
@ 2022-06-26 13:06 qnighy (Masaki Hara)
  2022-06-27 16:48 ` [ruby-core:109074] " lhmzhou (Linda Zhou)
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: qnighy (Masaki Hara) @ 2022-06-26 13:06 UTC (permalink / raw)
  To: ruby-core

Issue #18878 has been reported by qnighy (Masaki Hara).

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878

* Author: qnighy (Masaki Hara)
* Status: Open
* Priority: Normal
* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:109074] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  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 ` lhmzhou (Linda Zhou)
  2022-06-28  3:38 ` [ruby-core:109076] " qnighy (Masaki Hara)
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: lhmzhou (Linda Zhou) @ 2022-06-27 16:48 UTC (permalink / raw)
  To: ruby-core

Issue #18878 has been updated by lhmzhou (Linda Zhou).


Is there a more descriptive error message, or is `SyntaxError` the only output provided?

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-98219

* Author: qnighy (Masaki Hara)
* Status: Open
* Priority: Normal
* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:109076] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  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 ` qnighy (Masaki Hara)
  2023-08-30 20:26 ` [ruby-core:114598] " jeremyevans0 (Jeremy Evans) via ruby-core
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: qnighy (Masaki Hara) @ 2022-06-28  3:38 UTC (permalink / raw)
  To: ruby-core

Issue #18878 has been updated by qnighy (Masaki Hara).


> Is there a more descriptive error message, or is `SyntaxError` the only output provided?

This is the actual error message:

```
% ruby -e 'Foo::Bar {}'
-e:1: syntax error, unexpected '{'
Foo::Bar {}
```

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-98222

* Author: qnighy (Masaki Hara)
* Status: Open
* Priority: Normal
* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:114598] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  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 ` jeremyevans0 (Jeremy Evans) via ruby-core
  2025-03-21  4:46 ` [ruby-core:121420] [Ruby " qnighy (Masaki Hara) via ruby-core
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jeremyevans0 (Jeremy Evans) via ruby-core @ 2023-08-30 20:26 UTC (permalink / raw)
  To: ruby-core; +Cc: jeremyevans0 (Jeremy Evans)

Issue #18878 has been updated by jeremyevans0 (Jeremy Evans).


It looks like this will be fixed by YARP:

```
$ ruby -r yarp -e "pp YARP.parse('Foo::Bar {}')"
#<YARP::ParseResult:0x00000b1512acc448
 @comments=[],
 @errors=[],
 @source=#<YARP::Source:0x00000b14749d6690 @offsets=[0], @source="Foo::Bar {}">,
 @value=
  ProgramNode(0...11)(
    [],
    StatementsNode(0...11)(
      [CallNode(0...11)(ConstantReadNode(0...3)(), (3...5), (5...8), nil, nil, nil, BlockNode(9...11)([], nil, nil, (9...10), (10...11)), 0, "Bar")]
    )
  ),
 @warnings=[]>
```

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-104415

* Author: qnighy (Masaki Hara)
* Status: Open
* Priority: Normal
* 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/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:121420] [Ruby Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
                   ` (2 preceding siblings ...)
  2023-08-30 20:26 ` [ruby-core:114598] " jeremyevans0 (Jeremy Evans) via ruby-core
@ 2025-03-21  4:46 ` qnighy (Masaki Hara) via ruby-core
  2025-05-07  6:07 ` [ruby-core:121872] " mame (Yusuke Endoh) via ruby-core
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: qnighy (Masaki Hara) via ruby-core @ 2025-03-21  4:46 UTC (permalink / raw)
  To: ruby-core; +Cc: qnighy (Masaki Hara)

Issue #18878 has been updated by qnighy (Masaki Hara).


Now `Foo::Bar {}` parses in parse.y too, but `Foo::Bar {} + 1` still doesn't parse unlike in Prism.

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-112403

* Author: qnighy (Masaki Hara)
* Status: Open
* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:121872] [Ruby Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
                   ` (3 preceding siblings ...)
  2025-03-21  4:46 ` [ruby-core:121420] [Ruby " qnighy (Masaki Hara) via ruby-core
@ 2025-05-07  6:07 ` mame (Yusuke Endoh) via ruby-core
  2025-08-27 14:38 ` [ruby-core:123086] " yui-knk (Kaneko Yuichiro) via ruby-core
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2025-05-07  6:07 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #18878 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to ydah (Yudai Takada)

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-112939

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:123086] [Ruby Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
                   ` (4 preceding siblings ...)
  2025-05-07  6:07 ` [ruby-core:121872] " mame (Yusuke Endoh) via ruby-core
@ 2025-08-27 14:38 ` yui-knk (Kaneko Yuichiro) via ruby-core
  2025-09-01  1:44 ` [ruby-core:123150] " yui-knk (Kaneko Yuichiro) via ruby-core
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: yui-knk (Kaneko Yuichiro) via ruby-core @ 2025-08-27 14:38 UTC (permalink / raw)
  To: ruby-core; +Cc: yui-knk (Kaneko Yuichiro)

Issue #18878 has been updated by yui-knk (Kaneko Yuichiro).


Do we also support `Foo::Bar do end` (and `Foo::Bar do end + 1`)?
With `ruby 3.5.0dev (2025-08-27T03:02:56Z master 5ff7b2c582)` both parse.y and prism have same behavior for do block cases like below.

```ruby
bar do end        # method call
Bar do end        # method call
bar() do end      # method call
Bar() do end      # method call
Foo::bar do end   # method call
# Foo::Bar do end   # SyntaxError
Foo::bar() do end # method call
Foo::Bar() do end # method call
```

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-114398

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:123150] [Ruby Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
                   ` (5 preceding siblings ...)
  2025-08-27 14:38 ` [ruby-core:123086] " yui-knk (Kaneko Yuichiro) via ruby-core
@ 2025-09-01  1:44 ` yui-knk (Kaneko Yuichiro) via ruby-core
  2025-09-01  3:30 ` [ruby-core:123151] " yui-knk (Kaneko Yuichiro) via ruby-core
  2025-11-13  3:39 ` [ruby-core:123781] " yui-knk (Kaneko Yuichiro) via ruby-core
  8 siblings, 0 replies; 10+ messages in thread
From: yui-knk (Kaneko Yuichiro) via ruby-core @ 2025-09-01  1:44 UTC (permalink / raw)
  To: ruby-core; +Cc: yui-knk (Kaneko Yuichiro)

Issue #18878 has been updated by yui-knk (Kaneko Yuichiro).


Patch:

* Support only `Foo::Bar {} + 1`: https://github.com/yui-knk/ruby/tree/bug_18878_2
* Support both `Foo::Bar {} + 1` and `Foo::Bar do end` (and `Foo::Bar do end + 1`): https://github.com/yui-knk/ruby/tree/bug_18878

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-114482

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:123151] [Ruby Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
                   ` (6 preceding siblings ...)
  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
  2025-11-13  3:39 ` [ruby-core:123781] " yui-knk (Kaneko Yuichiro) via ruby-core
  8 siblings, 0 replies; 10+ messages in thread
From: yui-knk (Kaneko Yuichiro) via ruby-core @ 2025-09-01  3:30 UTC (permalink / raw)
  To: ruby-core; +Cc: yui-knk (Kaneko Yuichiro)

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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:123781] [Ruby Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
                   ` (7 preceding siblings ...)
  2025-09-01  3:30 ` [ruby-core:123151] " yui-knk (Kaneko Yuichiro) via ruby-core
@ 2025-11-13  3:39 ` yui-knk (Kaneko Yuichiro) via ruby-core
  8 siblings, 0 replies; 10+ messages in thread
From: yui-knk (Kaneko Yuichiro) via ruby-core @ 2025-11-13  3:39 UTC (permalink / raw)
  To: ruby-core; +Cc: yui-knk (Kaneko Yuichiro)

Issue #18878 has been updated by yui-knk (Kaneko Yuichiro).


Pull Request: https://github.com/ruby/ruby/pull/15165

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-115172

* 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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-11-13  3:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [ruby-core:123151] " yui-knk (Kaneko Yuichiro) via ruby-core
2025-11-13  3:39 ` [ruby-core:123781] " yui-knk (Kaneko Yuichiro) 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).