Zum Inhalt springen

Symbol and its member assigned together (CA2246)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key dotnet.codequality.symbol-member-same-statement · Severity warning · Category codequality

Microsoft analyzer CA2246. Flags a statement that assigns a variable and one of its members at once (a = a.Next = x). The member is set on the old object, which is rarely what was meant.

node = node.Next = candidate;
node.Next = candidate;
node = candidate;