CA1508: false positive on sub-sequential more strict condition #6868
Labels
Bug
The product is not behaving according to its current intended design
DataFlow
help wanted
The issue is up-for-grabs, and can be claimed by commenting
Milestone
Analyzer
Diagnostic ID: CA1508:
Avoid dead conditional code
Analyzer source
NuGet Package: Microsoft.CodeAnalysis.NetAnalyzers
Version: 8.0.0-preview.23364.2 (Latest)
Describe the bug
When variable checked to have one of two values and next checked to have one of those values specifically, CA1508 generated.
For specific code it is possible to workaround (with less code as a bonus) by inverting condition to check value doesn't have remaining possible values.
Steps To Reproduce
Expected behavior
No errors reported
Actual behavior
Error reported
Additional context
The text was updated successfully, but these errors were encountered: