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

undefined method `arguments' for nil:NilClass in Lint/AmbiguousOperator #8704

Closed
mwean opened this issue Sep 12, 2020 · 0 comments · Fixed by #8706
Closed

undefined method `arguments' for nil:NilClass in Lint/AmbiguousOperator #8704

mwean opened this issue Sep 12, 2020 · 0 comments · Fixed by #8706
Labels

Comments

@mwean
Copy link

mwean commented Sep 12, 2020

I ran into this error that I think is caused by the safe navigation operator.


Expected behavior

No error when running Lint/AmbiguousOperator on a file containing something like foo&.* -1

Actual behavior

undefined method `arguments' for nil:NilClass
gems/rubocop-0.90.0/lib/rubocop/cop/util.rb:37:in `add_parentheses'
gems/rubocop-0.90.0/lib/rubocop/cop/lint/ambiguous_operator.rb:51:in `block (2 levels) in on_new_investigation'
...

Steps to reproduce the problem

Run rubocop --only Lint/AmbiguousOperator -d --force-default-config on a file containing foo&.* -1

RuboCop version

$ [bundle exec] rubocop -V
0.90.0 (using Parser 2.7.1.4, rubocop-ast 0.4.0, running on ruby 2.5.7 x86_64-darwin18)
@koic koic added the bug label Sep 12, 2020
koic added a commit to koic/rubocop that referenced this issue Sep 12, 2020
Fixes rubocop#8704.

This PR fixes an error for `Lint/AmbiguousOperator`
when using safe navigation operator with a unary operator.
bbatsov pushed a commit that referenced this issue Sep 12, 2020
Fixes #8704.

This PR fixes an error for `Lint/AmbiguousOperator`
when using safe navigation operator with a unary operator.
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