False-positive for S1871:Two branches in a switch-case when one branches use different overloads of methods #5587
Labels
Area: C#
C# rules related issues.
Area: VB.NET
VB.NET rules related issues.
Type: False Positive
Rule IS triggered when it shouldn't be.
Projects
Milestone
Description
False positive when two branches in a switch-case use different overloads of the same method.
Rule:
S1871:Two branches in a conditional structure should not have exactly the same implementation
Repro steps
Expected behavior
No S1871
Actual behavior
S1871
Known workarounds
Workaround: Use a different name for one of the parameters in the case (e.g.
bool[] b
)Related information
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.37.0.45539">
The text was updated successfully, but these errors were encountered: