Fix S4158 FP: Should not report on HashSet.UnionWith for readonly fields. #8483
Labels
Area: C#
C# rules related issues.
Area: VB.NET
VB.NET rules related issues.
Type: CFG/SE FPs
Rule IS triggered when it shouldn't be for CFG and SE rules.
Milestone
https://sonarcloud.io/project/issues?open=AYqIsHtcRlgCy-_ohqo9&id=sonarlint-visualstudio
S4158 should not report on
UnionWith
, when the symbol is a read-only field. Because changing it to non-read-only is not a desirable action.To consider: should it be even raised on local variables? As there's no
AddRange
, and replacing the entire instance is not always an option.The text was updated successfully, but these errors were encountered: