Issue #18040 has been updated by Eregon (Benoit Daloze).

Status changed from Open to Rejected

One way to see it is to just forget that Jeremy called it statement.
One of the parser rule is named `stmt` and yes the produced AST node does return a value, like everything in Ruby.

It's not realistic for the Ruby grammar to accommodate what you ask in general as Jeremy said,
so I think it's safe to close this as "not realistically fixable". You are free to try to fix it though.

----------------------------------------
Feature #18040: Why should `foo(1 if true)` be an error?
https://bugs.ruby-lang.org/issues/18040#change-92964

* Author: bughit (bug hit)
* Status: Rejected
* Priority: Normal
----------------------------------------
There's no ambiguity here that should require another set of parens `foo((1 if true))`



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>