Issue #10024 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Rejected

`<<` and `>>` are shift operators primarily, and have higher precedence.

----------------------------------------
Bug #10024: Array injection of ternary operators injects boolean rather than ternary result
https://bugs.ruby-lang.org/issues/10024#change-47688

* Author: Blaine Kasten
* Status: Rejected
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* ruby -v: 2.1.2
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
The following code:

```ruby
a = []
a << ''.blank? ? 'blank' : 'not blank'

puts a
```
renders `[true]`.

I would expect it to render `['blank']`

If I wrap it in parenthesis it does work.

```ruby
a = []
a << ( ''.blank? ? 'blank' : 'not blank' )
puts a # ['blank']
```
it seems like the logic internally is perceiving this function as:

```ruby
(a << ''.blank?) ? 'blank' : 'not blank'
```
Which seems illogical.



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