Fix S2589 FN: Support recursive pattern redundant null check #9203
Labels
Area: CFG/SE
CFG and SE related issues.
Type: CFG/SE FPs
Rule IS triggered when it shouldn't be for CFG and SE rules.
Description
When using a property pattern
is { }
as a null check S2589 does not recognize it as redundant.Is that a bug or a deliberate design decision?
Repro steps
Expected behavior
E()
should report S2589Actual behavior
E()
does not report S2589Known workarounds
Use
is not null
instead ofis {}
to trigger S2589Related information
The text was updated successfully, but these errors were encountered: