Auto-correction for Style/RedundantParentheses
breaks code with yield
or super
#12124
Labels
Style/RedundantParentheses
breaks code with yield
or super
#12124
The issue occurs when the arguments of
yield
orsuper
are enclosed in parentheses, and the following conditions are met:yield
orsuper
yield
orsuper
and its argument(s)Here is an example of the code:
Note: The same issue occurs with
super
when replacingyield
withsuper
in the examples above.Expected behavior
I had expected one of the following three patterns:
Actual behavior
Before the correction,
42
was interpreted as an argument toyield
. However, after the correction, it interpretsyield
as having no arguments, and42
as separate.Steps to reproduce the problem
bundle exec rubocop -a example.rb
RuboCop version
The text was updated successfully, but these errors were encountered: