Skip to content

Commit 6c01dc3

Browse files
NoahS2003Copilot
andauthored
Fix grammatical error in method parameters documentation (#50114)
* Fix grammatical error in method parameters documentation Corrected the phrase "it's own value" to "its own value" for grammatical accuracy. * Fix spelling of 'referent' in assignment operator doc Corrected spelling of 'referent' in the explanation of ref assignments. * Update docs/csharp/language-reference/keywords/method-parameters.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 8721663 commit 6c01dc3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/csharp/language-reference/keywords/method-parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ You apply one of the following modifiers to a parameter declaration to pass argu
5757
- [`ref readonly`](#ref-readonly-modifier): The argument must be initialized before calling the method. The method can't assign a new value to the parameter.
5858
- [`in`](#in-parameter-modifier): The argument must be initialized before calling the method. The method can't assign a new value to the parameter. The compiler might create a temporary variable to hold a copy of the argument to `in` parameters.
5959

60-
A parameter that is passed by reference is a *reference variable*. It doesn't have it's own value. Instead, it refers to a different variable called its *referrent*. Reference variables can be [ref reassigned](../operators/assignment-operator.md#ref-assignment), which changes its referrent.
60+
A parameter that is passed by reference is a *reference variable*. It doesn't have its own value. Instead, it refers to a different variable called its *referent*. Reference variables can be [ref reassigned](../operators/assignment-operator.md#ref-assignment), which changes its referent.
6161

6262
Members of a class can't have signatures that differ only by `ref`, `ref readonly`, `in`, or `out`. A compiler error occurs if the only difference between two members of a type is that one of them has a `ref` parameter and the other has an `out`, `ref readonly`, or `in` parameter. However, methods can be overloaded when one method has a `ref`, `ref readonly`, `in`, or `out` parameter and the other has a parameter that is passed by value, as shown in the following example. In other situations that require signature matching, such as hiding or overriding, `in`, `ref`, `ref readonly`, and `out` are part of the signature and don't match each other.
6363

docs/csharp/language-reference/operators/assignment-operator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ In the preceding example, the [local reference variable](../statements/declarati
4343

4444
The left-hand operand of `ref` assignment can be a [local reference variable](../statements/declarations.md#reference-variables), a [`ref` field](../builtin-types/ref-struct.md#ref-fields), and a [`ref`](../keywords/ref.md), [`out`](../keywords/method-parameters.md#out-parameter-modifier), or [`in`](../keywords/method-parameters.md#in-parameter-modifier) method parameter. Both operands must be of the same type.
4545

46-
A `ref` assignment means that a reference variable has a different referrent. It's no longer referring to its previous referrent. Using `ref =` on a `ref` parameter means the parameter no longer refers to its argument. Any actions that modify the state of the object after ref reassigning it make those modifications to the new item. For example, consider the following method:
46+
A `ref` assignment means that a reference variable has a different referent. It's no longer referring to its previous referent. Using `ref =` on a `ref` parameter means the parameter no longer refers to its argument. Any actions that modify the state of the object after ref reassigning it make those modifications to the new item. For example, consider the following method:
4747

4848
:::code language="csharp" source="snippets/shared/AssignmentOperator.cs" id="SnippetRefReassignAndModify":::
4949

0 commit comments

Comments
 (0)