Fix S4158 FN: Collection Expressions (C# 12) #8539
Labels
Area: C#
C# rules related issues.
Area: C#12
C#12 related issues
Area: CFG/SE
CFG and SE related issues.
Type: False Negative
Rule is NOT triggered when it should be.
Description
Collection expressions are not handled by the SE engine, leading to FNs like this:
Repro steps
Expected behavior
S4158 raises a warning.
Actual behavior
No S4158 warnings are raised.
Related information
Implementation
With version 4.9.2 of Microsoft.CodeAnalysis.CSharp collection expressions are supported on the CFG level (previously it was always a NoneOperation).
A new
Processor
class is needed in the SE engine that can handleICollectionExpressionOperation
types (and also forISpreadOperation
).The text was updated successfully, but these errors were encountered: