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
Rule Change: no-extra-boolean-cast should check final expression in comma operator expressions #18186
Comments
Actually, now that I think about, there's an argument that both should flag by default. No matter which branch of |
Hi @kirkwaiblinger, thanks for this issue, as |
Agreed. Right now, So it feels to me like the current
The rule not flagging the |
Oh, these were very helpful examples. I understand better now. I had assumed that the point of the
Should we change the title to just be about that or is it different enough from the original post that it should be tracked under a new issue? |
@kirkwaiblinger we can reuse this issue. Can you update the title and description to focus specifically on sequence expressions? I agree that this is a bug with sequence expressions in |
A comma operator/sequence expression should have its last expression checked in a boolean context. For example, the following should flag:
since it is equivalent to
The original issue description was significantly different from the decided upon course of action. It is preserved below for reference:
The text was updated successfully, but these errors were encountered: