Fix S2589 FP: || and property patterns #7096
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
Description
While rewriting some older code to using pattern matching it triggered S2589 when using
||
together with a property pattern.When rewriting the disjunction with a logical pattern using
or
S2589 disappeared despite both lowered and compiled code are identical.Repro steps
Expected behavior
S2589 is not triggered for
Foo
Actual behavior
S2589 is triggered for
Foo
.Known workarounds
Rewrite
Foo
toBaz
.Related information
The text was updated successfully, but these errors were encountered: