We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
List.Clear()
1 parent 9d8052a commit 6efbd5fCopy full SHA for 6efbd5f
csharp/ql/test/library-tests/dataflow/collections/CollectionFlow.cs
@@ -358,6 +358,17 @@ public void ParamsNoFlow(A other)
358
SinkParams(new A[] { other }); // no flow
359
}
360
361
+ public void ListAddClearNoFlow()
362
+ {
363
+ var a = new A();
364
+ var list = new List<A>();
365
+ list.Add(a);
366
+ list.Clear();
367
+ Sink(list[0]); // no flow [FALSE NEGATIVE]
368
+ SinkListElem(list); // no flow [FALSE NEGATIVE]
369
+ Sink(ListFirst(list)); // no flow [FALSE NEGATIVE]
370
+ }
371
+
372
public static void Sink<T>(T t) { }
373
374
public static void SinkElem<T>(T[] ts) => Sink(ts[0]);
0 commit comments