Skip to content

Commit

Permalink
change wording on in, ref and out (dotnet#28370)
Browse files Browse the repository at this point in the history
This wording matches the comparisons on the `out` and `ref` pages.

Fixes dotnet#28316
  • Loading branch information
BillWagner authored Feb 24, 2022
1 parent 8f55a5e commit f265b89
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Variables passed as `in` arguments must be initialized before being passed in a

The `in` parameter modifier is available in C# 7.2 and later. Previous versions generate compiler error `CS8107` ("Feature 'readonly references' is not available in C# 7.0. Please use language version 7.2 or greater.") To configure the compiler language version, see [Select the C# language version](../configure-language-version.md).

Although `in`, `out`, and `ref` parameter modifiers are considered part of a signature, members declared in a single type cannot differ in signature solely by `in`, `ref` and `out`. Therefore, methods cannot be overloaded if the only difference is that one method takes a `ref` or `in` argument and the other takes an `out` argument. The following code, for example, will not compile:
Although `in`, `out`, and `ref` parameter modifiers are considered part of a signature, members declared in a single type cannot differ in signature solely by `in`, `ref` and `out`. Therefore, methods cannot be overloaded if the only difference is that one method takes a `ref` or `out` argument and the other takes an `in` argument. The following code, for example, will not compile:

```csharp
class CS0663_Example
Expand Down

0 comments on commit f265b89

Please sign in to comment.