Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S2252 FP: Rule raises issue in case of non integer value in for loop. #5428

Closed
csaba-sagi-sonarsource opened this issue Feb 24, 2022 · 0 comments · Fixed by #5523
Closed
Assignees
Labels
Area: C# C# rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@csaba-sagi-sonarsource
Copy link
Contributor

Description

S2252 raises issue in case of non integer value in for loop. Issue was raised by community, see https://community.sonarsource.com/t/this-loop-will-never-execute-will-execute-with-negative-and-decrementing/58753

Repro steps

for (var n = 0.0; n > -0.1; n -= 0.005)
{
}

Expected behavior

No issue is raised.

Actual behavior

An issue is raised.

Known workarounds

None

Related information

  • C#/VB.NET Plugins version: 8.36.0.43782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants