-
Notifications
You must be signed in to change notification settings - Fork 226
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
S2589 FP and FN: Conditional access and pattern matching #3910
Labels
Area: C#
C# rules related issues.
Area: CFG/SE
CFG and SE related issues.
Type: CFG/SE FPs
Rule IS triggered when it shouldn't be for CFG and SE rules.
Milestone
Comments
pavel-mikula-sonarsource
changed the title
S2589 FP after test with pattern matching
S2589 FP after test with conditional access and pattern matching
Jan 8, 2021
pavel-mikula-sonarsource
changed the title
S2589 FP after test with conditional access and pattern matching
Fix S2589 FP: Conditional access and pattern matching
Jan 8, 2021
Hi @jjolidon , Thank you for reporting this case. I can confirm it as False Positive. |
pavel-mikula-sonarsource
added
Area: C#
C# rules related issues.
Area: CFG/SE
CFG and SE related issues.
Type: False Positive
Rule IS triggered when it shouldn't be.
labels
Jan 8, 2021
pavel-mikula-sonarsource
changed the title
Fix S2589 FP: Conditional access and pattern matching
Fix S2589 FP and FN: Conditional access and pattern matching
Jan 8, 2021
pavel-mikula-sonarsource
added a commit
that referenced
this issue
Jan 8, 2021
pavel-mikula-sonarsource
added a commit
that referenced
this issue
Jan 12, 2021
pavel-mikula-sonarsource
added
Type: CFG/SE FPs
Rule IS triggered when it shouldn't be for CFG and SE rules.
and removed
Type: False Positive
Rule IS triggered when it shouldn't be.
labels
Jun 25, 2021
andrei-epure-sonarsource
changed the title
Fix S2589 FP and FN: Conditional access and pattern matching
S2589 FP and FN: Conditional access and pattern matching
Oct 14, 2022
Fixed by #7750 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: C#
C# rules related issues.
Area: CFG/SE
CFG and SE related issues.
Type: CFG/SE FPs
Rule IS triggered when it shouldn't be for CFG and SE rules.
Description
S2589 triggers a false positive for a null check after a first test with pattern matching.
Repro steps
Expected behavior
The above code should not trigger S2589
Actual behavior
The above code triggers S2589
Known workarounds
No known workaround
Related information
The text was updated successfully, but these errors were encountered: