Skip to content

Commit 1700510

Browse files
authored
Update method-parameters.md anchor problem (#43200)
fix: The anchor's ref-parameter-modifier and ref-readonly-modifier have been swapped.
1 parent 09cb0e2 commit 1700510

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ Informally, you can think of these scopes as the mechanism to ensure your code n
5858

5959
You apply one of the following modifiers to a parameter declaration to pass arguments by reference instead of by value:
6060

61-
- [`ref`](#ref-readonly-modifier): The argument must be initialized before calling the method. The method can assign a new value to the parameter, but isn't required to do so.
61+
- [`ref`](#ref-parameter-modifier): The argument must be initialized before calling the method. The method can assign a new value to the parameter, but isn't required to do so.
6262
- [`out`](#out-parameter-modifier): The calling method isn't required to initialize the argument before calling the method. The method must assign a value to the parameter.
63-
- [`readonly ref`](#ref-parameter-modifier): The argument must be initialized before calling the method. The method can't assign a new value to the parameter.
63+
- [`readonly ref`](#ref-readonly-modifier): The argument must be initialized before calling the method. The method can't assign a new value to the parameter.
6464
- [`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.
6565

6666
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.

0 commit comments

Comments
 (0)