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

Lint/UselessAssignment ignores unused variable in multiple rescue case #1211

Closed
ojab opened this issue Jul 15, 2014 · 1 comment · Fixed by #1290
Closed

Lint/UselessAssignment ignores unused variable in multiple rescue case #1211

ojab opened this issue Jul 15, 2014 · 1 comment · Fixed by #1290
Assignees
Labels

Comments

@ojab
Copy link
Contributor

ojab commented Jul 15, 2014

Testcase for rubocop 0.24.1 (using Parser 2.2.0.pre.3, running on ruby 2.1.2 x86_64-darwin13.0):

def foo
  1 / 0
rescue RuntimeError => e
  puts 2
rescue
  puts e
end

or

def foo
  1 / 0
rescue RuntimeError => e
  puts 2
rescue => e
  1.times do
    puts e
  end
end

e is unused in rescue RuntimeError, but rubocop tells that no offenses detected.

@bbatsov
Copy link
Collaborator

bbatsov commented Jul 17, 2014

I guess @yujinakayama will take a look at this.

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.

3 participants