-
Notifications
You must be signed in to change notification settings - Fork 778
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
0.8.1: LGTM flagged an always-true comparison #629
Comments
|
I think this issue that the LGTM knows that So it's basically a developer/code-consistency check. Any voilation of this will be caught in the CI unit tests, when run with assertions. It's a bit like having: |
Well, known at compile time is not clear to me.
Yes it is.
In theory, yes, no user should break the contract, and code should be tested with I appreciate that the answer to above scenario is not an obvious trivial clear/cut decision, there are arguments to both sides. In this case though, what pushed me towards providing a return error value is the fact that the same design is already in place for other established public symbols of |
I agree @Cyan4973 , thanks for the explanation. I was wondering why Lgtm didn't also flag the assert criteria as well, and it now makes sense. In the debug case, the only logical way execution ever makes it to (If we gave Lgtm a release build, then it would not come to this conclusion, but it would flag many other errors that asserts are meant to catch). Is it possible to hide the This is the only instance flagged, so is quite a unique check in the codebase. |
Checking debug mode for the |
The text was updated successfully, but these errors were encountered: