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
Appears to be a regression related to an earlier issue: #4366. When running merge!, passing a kwsplat as the sole argument causes rubocop to raise undefined method 'source' for nil:NilClass.
Expected behavior
Rubocop should not raise an error.
Actual behavior
Error raised in RuboCop::Cop::Performance::RedundantMerge#to_assignments.
An error occurred while Performance/RedundantMerge cop was inspecting test:55:8.
undefined method `source' for nil:NilClass
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:99:in `block in to_assignments'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:92:in `map'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:92:in `to_assignments'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:47:in `block in message'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:19:in `redundant_merge_candidate'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:46:in `message'
rubocop-0.60.0/lib/rubocop/cop/cop.rb:128:in `add_offense'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:27:in `block in on_send'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:57:in `block in each_redundant_merge'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:19:in `redundant_merge_candidate'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:54:in `each_redundant_merge'
rubocop-0.60.0/lib/rubocop/cop/performance/redundant_merge.rb:26:in `on_send'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:58:in `block (2 levels) in trigger_responding_cops'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:106:in `with_cop_error_handling'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:57:in `block in trigger_responding_cops'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:56:in `each'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:56:in `trigger_responding_cops'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:34:in `block (2 levels) in <class:Commissioner>'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:50:in `block in on_begin'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:50:in `each'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:50:in `on_begin'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:100:in `on_def'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:50:in `block in on_begin'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:50:in `each'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:50:in `on_begin'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:150:in `on_while'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:150:in `on_while'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:150:in `on_while'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:35:in `block (2 levels) in <class:Commissioner>'
rubocop-0.60.0/lib/rubocop/ast/traversal.rb:13:in `walk'
rubocop-0.60.0/lib/rubocop/cop/commissioner.rb:46:in `investigate'
rubocop-0.60.0/lib/rubocop/cop/team.rb:116:in `investigate'
rubocop-0.60.0/lib/rubocop/cop/team.rb:104:in `offenses'
rubocop-0.60.0/lib/rubocop/cop/team.rb:44:in `inspect_file'
rubocop-0.60.0/lib/rubocop/runner.rb:269:in `inspect_file'
rubocop-0.60.0/lib/rubocop/runner.rb:216:in `block in do_inspection_loop'
rubocop-0.60.0/lib/rubocop/runner.rb:248:in `block in iterate_until_no_changes'
rubocop-0.60.0/lib/rubocop/runner.rb:241:in `loop'
rubocop-0.60.0/lib/rubocop/runner.rb:241:in `iterate_until_no_changes'
rubocop-0.60.0/lib/rubocop/runner.rb:212:in `do_inspection_loop'
rubocop-0.60.0/lib/rubocop/runner.rb:115:in `block in file_offenses'
rubocop-0.60.0/lib/rubocop/runner.rb:133:in `file_offense_cache'
rubocop-0.60.0/lib/rubocop/runner.rb:113:in `file_offenses'
rubocop-0.60.0/lib/rubocop/runner.rb:101:in `process_file'
rubocop-0.60.0/lib/rubocop/runner.rb:78:in `block in each_inspected_file'
rubocop-0.60.0/lib/rubocop/runner.rb:75:in `each'
rubocop-0.60.0/lib/rubocop/runner.rb:75:in `reduce'
rubocop-0.60.0/lib/rubocop/runner.rb:75:in `each_inspected_file'
rubocop-0.60.0/lib/rubocop/runner.rb:67:in `inspect_files'
rubocop-0.60.0/lib/rubocop/runner.rb:39:in `run'
rubocop-0.60.0/lib/rubocop/cli.rb:157:in `execute_runner'
rubocop-0.60.0/lib/rubocop/cli.rb:85:in `execute_runners'
rubocop-0.60.0/lib/rubocop/cli.rb:41:in `run'
rubocop-0.60.0/exe/rubocop:13:in `block in <top (required)>'
ruby-2.5.1/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
rubocop-0.60.0/exe/rubocop:12:in `<top (required)>'
bin/rubocop:23:in `load'
bin/rubocop:23:in `<main>'
bin/ruby_executable_hooks:15:in `eval'
bin/ruby_executable_hooks:15:in `<main>'
Appears to be a regression related to an earlier issue: #4366. When running
merge!
, passing akwsplat
as the sole argument causes rubocop to raiseundefined method 'source' for nil:NilClass
.Expected behavior
Rubocop should not raise an error.
Actual behavior
Error raised in
RuboCop::Cop::Performance::RedundantMerge#to_assignments
.Steps to reproduce the problem
RuboCop version
Ruby version
The text was updated successfully, but these errors were encountered: