Pattern: Unnecessary null-aware assignment
Issue: -
Using null
on the right-hand side of a null-aware assignment effectively makes the assignment redundant.
Example of correct code:
var x;
x ??= 1;
Example of incorrect code:
var x;
x ??= null;
Pattern: Unnecessary null-aware assignment
Issue: -
Using null
on the right-hand side of a null-aware assignment effectively makes the assignment redundant.
Example of correct code:
var x;
x ??= 1;
Example of incorrect code:
var x;
x ??= null;