Skip to content

Commit

Permalink
NET-1151 Repro FP S3626
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-marichal authored and sonartech committed Feb 28, 2025
1 parent 88381f2 commit d9a8fd0
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,32 @@ public class Log
{
public void Finally() { }
}

// https://sonarsource.atlassian.net/browse/NET-1149
public class Repro_1149
{
public void Method(List<string> items)
{
items.ForEach(LocalFunction);

return; // Noncompliant - FP

void LocalFunction(string item)
{
Console.WriteLine(item);
}
}
public void Method2(List<string> items)
{
void LocalFunction(string item)
{
Console.WriteLine(item);
}

items.ForEach(LocalFunction);

return; // Noncompliant
}
}
}

0 comments on commit d9a8fd0

Please sign in to comment.