S2589 FP: Rule is raised on catch-all tuples in switch expressions #8008
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
S2589 is raised on catch-all tuples in switch expressions.
This is a common pattern when using truth-table like exhaustive switch expressions when aligning tuple members for a consistent condition style. (See the repro steps.)
Repro steps
Expected behavior
S2589 is not raised.
Actual behavior
S2589 is raised on the
(_, _)
case.Known workarounds
Use a plain catch-all
_
case instead - but this breaks the stylistic similarity and alignment of all the switch expression cases.Related information
The text was updated successfully, but these errors were encountered: