/ sonar-dotnet Public
Fix S1905 FP: Nullability context and array of anonymous types #6438
C# rules related issues.
Short-lived label (that will live long due to reusability)
Type: False Positive
Rule IS triggered when it shouldn't be.
In a .net 6 project where nullable reference types is enabled, in the example below the casts to string? are necessary, otherwise the nullability of x in the two array elements doesn't match and this produces a CS8206 error
No S1905 warning is produced
S1905 warning is produced
Don't use anonymous types and create a class with a property x of type string? and declare the array of that type
The text was updated successfully, but these errors were encountered: