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

Error in MethodCallWithArgsParentheses auto-correct #4275

Closed
aripollak opened this issue Apr 13, 2017 · 1 comment
Closed

Error in MethodCallWithArgsParentheses auto-correct #4275

aripollak opened this issue Apr 13, 2017 · 1 comment

Comments

@aripollak
Copy link

With MethodCallWithArgsParentheses enabled, running rubocop -a on this file:

def foo
  yield true
end

Results in this exception:

undefined method `selector' for #<Parser::Source::Map::Keyword:0x0055d603311da0>
/home/ari/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rubocop-0.48.1/lib/rubocop/cop/style/method_call_with_args_parentheses.rb:96:in `args_begin'
/home/ari/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/rubocop-0.48.1/lib/rubocop/cop/style/method_call_with_args_parentheses.rb:69:in `block in autocorrect'

RuboCop version

Include the output of rubocop -V. Here's an example:

$ rubocop -V
0.48.1 (using Parser 2.4.0.0, running on ruby 2.3.3 x86_64-linux)
@Drenmi
Copy link
Collaborator

Drenmi commented Apr 20, 2017

Thanks for the report @aripollak. I can reproduce this issue. Will work in it tonight. 🙂

Drenmi added a commit to Drenmi/rubocop that referenced this issue Apr 20, 2017
… blowing up on `yield`

When attempting to auto-correct a `yield` with arguments, this cop would
blow up. This change fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants