CA1862 false positive with the same variable on both sides of the comparison #7074
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers
Bug
The product is not behaving according to its current intended design
False_Positive
A diagnostic is reported for non-problematic case
help wanted
The issue is up-for-grabs, and can be claimed by commenting
Milestone
Analyzer
Diagnostic ID: CA1862:
Use the 'StringComparison' method overloads to perform case-insensitive string comparisons
Analyzer source
SDK: Built-in CA analyzers in .NET 8 SDK
Version: SDK 8.0.100
Describe the bug
CA1862 should not be shown when the same variable is on both sides of the comparison.
Steps To Reproduce
And the suggested fix changes the behavior completely:
The text was updated successfully, but these errors were encountered: