Skip to content

Commit 57dc53f

Browse files
authored
Hyphenate null-conditional (#46040)
1 parent 68f85b6 commit 57dc53f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/csharp/whats-new/csharp-14.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ Only the implementing declaration of a partial constructor can include a constru
136136

137137
The implementing declaration of a partial event must include `add` and `remove` accessors. The defining declaration declares a field-like event.
138138

139-
## Null conditional assignment
139+
## Null-conditional assignment
140140

141-
The null conditional member access operators, `?.` and ``?[]`, can now be used on the left hand side of an assignment or compound assignment.
141+
The null-conditional member access operators, `?.` and `?[]`, can now be used on the left hand side of an assignment or compound assignment.
142142

143143
Before C# 14, you needed to null-check a variable before assigning to a property:
144144

@@ -157,9 +157,9 @@ customer?.Order = GetCurrentOrder();
157157

158158
The right side of the `=` operator is evaluated only when the left side isn't null. If `customer` is null, the code doesn't call `GetCurrentOrder`.
159159

160-
In addition to assignment, you can use null conditional member access operators with compound assignment operators (`+=`, `-=`, and others). However, increment and decrement, `++` and `--`, aren't allowed.
160+
In addition to assignment, you can use null-conditional member access operators with compound assignment operators (`+=`, `-=`, and others). However, increment and decrement, `++` and `--`, aren't allowed.
161161

162-
You can learn more in the language reference article on the [conditional member access](../language-reference/operators/member-access-operators.md#null-conditional-operators--and-) and the feature specification for [null conditional assignment](~/_csharplang/proposals/null-conditional-assignment.md)
162+
You can learn more in the language reference article on the [conditional member access](../language-reference/operators/member-access-operators.md#null-conditional-operators--and-) and the feature specification for [null-conditional assignment](~/_csharplang/proposals/null-conditional-assignment.md).
163163

164164
## See also
165165

0 commit comments

Comments
 (0)