Project

General

Profile

Feature #16451

Updated by myxoh (Nicolas Klein) 3 months ago

When a method ends in `?`, we should be able to skip the `?` in the ternary operator. For example, we should be able to do: 

 ```ruby 
 question_method? true_statement : false_statement 
 ``` 

 This shouldn't interfere with implementations, as it currently fails to parse. Below are examples: 

 ```ruby 
 def normal_method; true end 
 def question_method?; false end 

 question_method? ? 'was true' : 'was false' # => 'was false' true' 
 question_method?     'was true' : 'was false' # => 'was false' 
 normal_method ?      'was true' : 'was false' # => 'was true' 
 ```

Back