1 parent 9654f35 commit 2d16e61Copy full SHA for 2d16e61
1 file changed
analyzers/tests/SonarAnalyzer.Test/TestCases/MethodParameterUnused.Latest.cs
@@ -477,3 +477,26 @@ private static string CaptureSimple(string text) // Compliant
477
}
478
479
480
+
481
+namespace ReproNET2384
482
+{
483
+ class Test
484
+ {
485
+ // https://sonarsource.atlassian.net/browse/NET-2384
486
+ void Method(string? a, string? b) // Noncompliant FP for string? b. The b value is read if a is null
487
488
+ LocalFunction();
489
+ void LocalFunction()
490
491
+ if (a != null)
492
493
+ b = null; // modify b only if a is not null
494
+ }
495
+ if (b != null)
496
497
+ //...
498
499
500
501
502
+}
0 commit comments