Fix FP S2589: Assignment for captures are ignored #9204
Labels
Area: C#
C# rules related issues.
Area: CFG/SE
CFG and SE related issues.
Type: False Positive
Rule IS triggered when it shouldn't be.
Originally reported at https://community.sonarsource.com/t/false-positive-for-s2589/114185
Description
Any mutation of a captured variable is ignored. This applies to captures by delegates and by local functions. See also #8885
Repro steps
Expected behavior
Do not raise on mutated captured variables or learn inside the delegate/local function body.
Actual behavior
FP for S2589
Known workarounds
Do not mutate capture variables.
The text was updated successfully, but these errors were encountered: