-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Style/EmptyLiteral is (possibly) not safe #6648
Labels
Comments
This likely applies to any method, not just |
Other methods are a non issue. They were already accounted for. |
rrosenblum
added a commit
to rrosenblum/rubocop
that referenced
this issue
Jan 16, 2019
…correcting Hash.new is the fist argument to super
Drenmi
added a commit
that referenced
this issue
Jan 22, 2019
[Fix #6648] EmptyLiteral - wrap arguments in parentheses when correcting Hash.new is the fist argument to super
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've encountered a situation where this cop is possibly not safe.
I have a class with subclasses. The constructor for the parent class accepts a hash, and I want this to be an empty hash in one of the child classes.
When I autocorrect the child class it gets changed to:
Which is not equivalent. This results in the argument
string
being passed to the super call (i.e. it behaves as a 'bare'super
call). Changing this line tosuper({})
causes it to work as expected.The text was updated successfully, but these errors were encountered: