Fix S2589 FP: Rule ignores case guards #9663
Labels
Area: C#
C# rules related issues.
Type: CFG/SE FPs
Rule IS triggered when it shouldn't be for CFG and SE rules.
Description
S2589 is raised on a switch expression on a tuple where the second parameter is discarded but for the first one there is a guard clause.
Repro steps
Expected behavior
S2589 is not raised
Actual behavior
S2589 is raised on the line containing: (var x, _) when x.StartsWith("CD") => "CD",
Known workarounds
None/ Disable with pragma
Related information
Kindof relates to: #8008
The text was updated successfully, but these errors were encountered: