forked from rubocop/rubocop
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an error for
Lint/UselessRuby2Keywords
This PR fixes the following error for `Lint/UselessRuby2Keywords` when using `Proc#ruby2_keywords`. ```ruby block = proc { |_, *args| klass.new(*args) } block.ruby2_keywords if block.respond_to?(:ruby2_keywords ``` ```console % bundle exec rubocop --only Lint/UselessRuby2Keywords -d (snip) An error occurred while Lint/UselessRuby2Keywords cop was inspecting /Users/koic/src/github.com/koic/rubocop-issues/ruby2_keywords/example.rb:2:0. undefined method `def_type?' for nil:NilClass /Users/koic/src/github.com/rubocop/rubocop/lib/rubocop/cop/lint/useless_ruby2_keywords.rb:80:in `on_send' ```
- Loading branch information
Showing
3 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#11369](https://github.com/rubocop/rubocop/pull/11369): Fix an error for `Lint/UselessRuby2Keywords` when using `Proc#ruby2_keywords`. ([@koic][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters