Issue #18040 has been updated by bughit (bug hit).


jeremyevans0 (Jeremy Evans) wrote in #note-1:
> `1 if true` is a statement and not an expression

`1 if true` is an expression (as pretty much everything in ruby) whose value is nil, if the condition is false, else the modified subexpression. Parens don't turn it into an expression, it already is one.

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

* Author: bughit (bug hit)
* Status: Open
* 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>