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
When running merge! on a catch-all function argument, passing a double-splatted hash causes rubocop to raise undefined method 'source' for nil:NilClass
Expected behavior
Rubocop should not raise an error.
Actual behavior
Error in RuboCop::Cop::Performance::RedundantMerge#to_assignments.
Stacktrace:
An error occurred while Performance/RedundantMerge cop was inspecting test2.rb:4:2.
undefined method `source' for nil:NilClass
rubocop-0.48.1/lib/rubocop/cop/performance/redundant_merge.rb:79:in `block in to_assignments'
rubocop-0.48.1/lib/rubocop/cop/performance/redundant_merge.rb:74:in `map'
rubocop-0.48.1/lib/rubocop/cop/performance/redundant_merge.rb:74:in `to_assignments'
rubocop-0.48.1/lib/rubocop/cop/performance/redundant_merge.rb:24:in `block in on_send'
rubocop-0.48.1/lib/rubocop/cop/performance/redundant_merge.rb:53:in `block in each_redundant_merge'
rubocop-0.48.1/lib/rubocop/cop/performance/redundant_merge.rb:18:in `redundant_merge'
rubocop-0.48.1/lib/rubocop/cop/performance/redundant_merge.rb:46:in `each_redundant_merge'
rubocop-0.48.1/lib/rubocop/cop/performance/redundant_merge.rb:23:in `on_send'
…up on double splat argument
This cop would raise an error when encountering a double splat argument:
```
foo.merge!(**bar)
```
This change fixes that.
When running
merge!
on a catch-all function argument, passing a double-splatted hash causes rubocop to raiseundefined method 'source' for nil:NilClass
Expected behavior
Rubocop should not raise an error.
Actual behavior
Error in
RuboCop::Cop::Performance::RedundantMerge#to_assignments
.Stacktrace:
Steps to reproduce the problem
RuboCop version
Ruby version
The text was updated successfully, but these errors were encountered: