You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error occurred while Performance/MapCompact cop was inspecting /home/zverok/playground/ruby/rubocop-debug/test.rb:1:19.
undefined method `selector' for #<Parser::Source::Map::Variable:0x0000560675f2dc18>
/home/zverok/.rvm/gems/ruby-2.6.3/gems/rubocop-performance-1.11.2/lib/rubocop/cop/performance/map_compact.rb:78:in `invoke_method_after_map_compact_on_same_line?'
Note that the bug is NOT reproduced if we'll change code to the following:
Minimal test case:
Run:
rubocop test.rb --only Performance/MapCompact -d
Outcome:
Note that the bug is NOT reproduced if we'll change code to the following:
(Cop just suggest expected change: to use
filter_map
)Putting aside the question "why the heck anybody will write code like that" (legacy codebase!), this seem to clearly be a bug.
Versions:
1.14.0 (using Parser 3.0.1.1, rubocop-ast 1.5.0, running on ruby 2.6.3 x86_64-linux)
The text was updated successfully, but these errors were encountered: