-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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/warning for unary -,+ in void context? #33859
Comments
I've defined |
I realize that's not a serious comment, but that wouldn't be in void context, so this change actually wouldn't break your workflow 😁 |
Actually it would be in a void context—the point of the joke was that this would only affect someone who has perversely defined a unwary +/- method with a side effect. |
I recently lost half a day in debugging a statement of the form
which is not the desired I can understand that a leading |
I recently saw a case where code like this:
was reformatted to:
Of course, that silently changes the
x
value computed, and the value of- h(z)
is just ignored. While rare, it's totally understandable how a change like this could be made accidentally. It makes me wonder if we should actually make this an error. Very few cases are affected; this can basically only happen with-
and+
, and it's hard to see why you would want to call those with one argument in void context.The text was updated successfully, but these errors were encountered: