From aeffa19071ac13c400fba4cfbea7c7fe6fb5c786 Mon Sep 17 00:00:00 2001 From: Dan Friedman <1784452+MisinformedDNA@users.noreply.github.com> Date: Fri, 17 Oct 2025 09:08:11 -0500 Subject: [PATCH] Update code snippet reference for null assignment --- .../language-reference/operators/member-access-operators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/language-reference/operators/member-access-operators.md b/docs/csharp/language-reference/operators/member-access-operators.md index f86f54f164c6b..9dda13cf2fd61 100644 --- a/docs/csharp/language-reference/operators/member-access-operators.md +++ b/docs/csharp/language-reference/operators/member-access-operators.md @@ -155,7 +155,7 @@ Beginning in C# 14, assignment is permissible with a null conditional access exp The preceding example shows assignment to a property and an indexed element on a reference type that might be null. An important behavior for this assignment is that the expression on the right-hand side of the `=` is evaluated only when the left-hand side is known to be non-null. For example, in the following code, the function `GenerateNextIndex` is called only when the `values` array isn't null. If the `values` array is null, `GenerateNextIndex` isn't called: -:::code language="csharp" source="snippets/shared/NullCoalescingOperator.cs" id="NullForgivingAssignment"::: +:::code language="csharp" source="snippets/shared/NullCoalescingOperator.cs" id="ConditionalRHS"::: In other words, the preceding code is equivalent to the following code using an `if` statement for the null check: