Skip to content

Commit

Permalink
S2583: Add FP repro for #8470
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-mikula-sonarsource committed Dec 18, 2023
1 parent 2adeba2 commit 4e9ed5c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3483,3 +3483,21 @@ public static void Foo()
}
}
}

// https://github.com/SonarSource/sonar-dotnet/issues/8470
public class Repro_8470
{
public string Go()
{
double t = 0.5;
if (t <= 0)
{
return "a";
}
if (t >= 1) // Noncompliant FP
{
return "b";
}
return "c"; // Secondary FP
}
}

0 comments on commit 4e9ed5c

Please sign in to comment.