Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False-positive Lint/LambdaWithoutLiteralBlock when using itself #10489

Closed
WaKeMaTTa opened this issue Mar 30, 2022 · 0 comments · Fixed by #10490
Closed

False-positive Lint/LambdaWithoutLiteralBlock when using itself #10489

WaKeMaTTa opened this issue Mar 30, 2022 · 0 comments · Fixed by #10490
Labels

Comments

@WaKeMaTTa
Copy link

WaKeMaTTa commented Mar 30, 2022

Expected behavior

Rubocop shouldn't complain.

Actual behavior

Rubocop complains with Lint/LambdaWithoutLiteralBlock.

Steps to reproduce the problem

my_file.rb

service = lambda(&:itself)
service.call("Hello")

$ bundle exec rubocop my_file.rb

my_file.rb:10:1: W: [Correctable] Lint/LambdaWithoutLiteralBlock: lambda without a literal block is deprecated; use the proc without lambda instead.

RuboCop version

$ [bundle exec] rubocop -V
1.26.1 (using Parser 3.1.1.0, rubocop-ast 1.16.0, running on ruby 3.0.1 x86_64-linux)
  - rubocop-performance 1.13.3
  - rubocop-rails 2.14.2
  - rubocop-rspec 2.9.0
@koic koic added the bug label Mar 30, 2022
koic added a commit to koic/rubocop that referenced this issue Mar 30, 2022
…alBlock`

Fixes rubocop#10489.

This PR fixes a false positive for `Lint/LambdaWithoutLiteralBlock`
when using lambda with a symbol proc.
bbatsov pushed a commit that referenced this issue Apr 2, 2022
Fixes #10489.

This PR fixes a false positive for `Lint/LambdaWithoutLiteralBlock`
when using lambda with a symbol proc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants