Closed TastyPi closed 5 months ago
class RubocopIssue def self.around(&around_block) define_method(:around) do |&test_block| around_block.call { super(&test_block) } end end end
gets turned into
class RubocopIssue def self.around(&around_block) define_method(:around) do |&test_block| yield { super(&test_block) } end end end
which is a syntax error:
syntax error, unexpected '{' (SyntaxError) yield { super(&test_block) } ^
rubocop-performance should only produce valid code
rubocop-performance
rubocop-performance produced a syntax error
Run rubocop-performance on the example above
1.62.1 (using Parser 3.3.0.5, rubocop-ast 1.31.2, running on ruby 3.2.2) +server [x86_64-linux]
gets turned into
which is a syntax error:
Expected behavior
rubocop-performance
should only produce valid codeActual behavior
rubocop-performance
produced a syntax errorSteps to reproduce the problem
Run
rubocop-performance
on the example aboveRuboCop version
1.62.1 (using Parser 3.3.0.5, rubocop-ast 1.31.2, running on ruby 3.2.2) +server [x86_64-linux]