Skip to content

Commit d9a8fd0

Browse files
sebastien-marichalsonartech
authored andcommitted
NET-1151 Repro FP S3626
1 parent 88381f2 commit d9a8fd0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

analyzers/tests/SonarAnalyzer.Test/TestCases/RedundantJumpStatement.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,32 @@ public class Log
259259
{
260260
public void Finally() { }
261261
}
262+
263+
// https://sonarsource.atlassian.net/browse/NET-1149
264+
public class Repro_1149
265+
{
266+
public void Method(List<string> items)
267+
{
268+
items.ForEach(LocalFunction);
269+
270+
return; // Noncompliant - FP
271+
272+
void LocalFunction(string item)
273+
{
274+
Console.WriteLine(item);
275+
}
276+
}
277+
public void Method2(List<string> items)
278+
{
279+
void LocalFunction(string item)
280+
{
281+
Console.WriteLine(item);
282+
}
283+
284+
items.ForEach(LocalFunction);
285+
286+
return; // Noncompliant
287+
}
288+
}
262289
}
290+

0 commit comments

Comments
 (0)