Analyzer produces incomplete set of warnings for conditional control flow with arrays
- Dominant language
- C#
- Stars
- 392
- Forks
- 128
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 2
Description
```c#
void TestMergedArrayElementWithUnknownIndex (int i)
{
Type[] arr = new Type[] { null };
if (i == 1)
arr[0] = GetMethods (); // PublicMethods
else
arr[i] = GetFields (); // UnknownValue
arr[0].RequiresAll (); // Should produce 2 warnings IL2062 and IL2072, analyzer issues only IL2062
}
```
Test comes from [ArrayDataFlow.cs](https://github.com/dotnet/linker/blob/main/test/Mono.Linker.Tests.Cases/DataFlow/ArrayDataFlow.cs)
The multi value at array's index 0 should contain two values after the merge, one coming from the `if` branch, and the other resulting from assigning the value at unknown index in the `else` branch. Thus 2 warnings should be produced.
The analyzer only produces the warning corresponding to assigning the value at unknown index.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.