Style/RedundantParentheses
makes wrong ternary autocorrection
#5075
Labels
Style/RedundantParentheses
makes wrong ternary autocorrection
#5075
While cleaning up a large codebase, I stumbled upon the autocorrection plunder below.
Expected behavior
Style/RedundantParentheses
should autocorrect this line of code:to
Actual behavior
However, what actually happens is that the necessary whitespace is not added. And non-executable code is produced in place of the ternary.
Attempting to execute the corrected line (where
active?
is also a defined method):Steps to reproduce the problem
Run rubocop autocorrection on this snippet to produce the results described above.
RuboCop version
The text was updated successfully, but these errors were encountered: