-
Notifications
You must be signed in to change notification settings - Fork 227
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
Fix S2583: Rule should consider Nullable<bool> values #152
Comments
The problem is that we set a true or false constraint on SV_x when a constraint is set on x == true, however there's a third option that the x == true is false due to x being null, and == being the lifted operator. |
@Evangelink, @valhristov This is one of the bigger bugs that I left behind. I started fixing it in https://github.com/tamasvajk/sonar-csharp/tree/feature/152, but I rarely find the time to work on it. As I see, this problem is not just about
I think one way to solve this issue is to
Branch implements point 1. Point 2 is a bit tedious, and before I got there I realized that this solution leads a bit too far, namely (implicit) type changes and casts should be handled in some form: Currently, for
So this note is just to let you know that the branch is there, and could be continued, but before that some decision needs to be made. (And I guess, this should not come from a contributor.) |
The following code generates a false positive:
The text was updated successfully, but these errors were encountered: