-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add rule for ?? nil
#764
Comments
I'd like to take this one on. Working on it now. |
Hmmm, actually there are cases where this is valid, for example when lhs is a double optional: |
I'll make it an opt-in rule for now |
nitpick: I believe coalesing should be changed to coalescing, you actually spelled it correctly once in the description description: "nil coalescing operator is only evaluated if the lhs is nil " + ", coalesing operator with nil as rhs is redundant", |
This was implemented in #773 and could be closed |
Thanks! |
This is always redundant as the
rhs
of the nil coalescing operator is only ever evaluated if the lhs isnil
. This should really be a warning in the Swift compiler...The text was updated successfully, but these errors were encountered: