I'm using a Ruby linter in Atom and for some lines it gives the following warning:
(...) interpreted as grouped expression
An example of a line that get's this warning is this:
elsif not (params[:vacancy].nil? or params[:vacancy]['company_id'].nil? or params[:vacancy]['company_id'] == "0" )
How should that line be improved to make the warning go away?
The warning is
(...) interpreted as grouped expression
And it means exactly what it says: in Ruby, parentheses can be used for three purposes, expression grouping, parameter lists and argument lists. This warning is emitted when Ruby thinks that you want an argument list but wrote a grouped expression instead. The most common cause is whitespace between the name of the message and the argument list in a message send like this:
foo.bar (1, 2)
This will be interpreted not as an argument list for the message send, but rather a grouped expression, which, in this particular case, is a SyntaxError
.
In your particular case, the warning seems to be a false positive.
Try to Remove the space between not
and the parenthesis
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With