Open Unarimit opened 1 month ago
this issue appear in this subheading https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/method-parameters#combinations-of-parameter-type-and-argument-mode
We should update this page and introduce the term "referent", which as added to the standard in C# 7.3. Then, that can clarify how a ref
argument can be assigned:
num = 12;
That change is visible outside the methodnum ref = someVariable;
That change won't be visible outside the method.Adding this to our backlog to fix on our next update in this section.
We should update this page and introduce the term "referent", which as added to the standard in C# 7.3. Then, that can clarify how a
ref
argument can be assigned:
- Assigning a new value changes the value of the current referent:
num = 12;
That change is visible outside the method- Ref assigning to change the referent means the variable refers to different storage:
num ref = someVariable;
That change won't be visible outside the method.Adding this to our backlog to fix on our next update in this section.
Thank you for your reply. Yeah, a new feature🥲
Type of issue
Typo
Description
Does it mean such method as
void foo(ref int num)
is not reasonable? I can not got it.Page URL
https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/keywords/method-parameters
Content source URL
https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/keywords/method-parameters.md
Document Version Independent Id
7241f712-8d73-b5e0-37c0-5f05c92412c6
Article author
@BillWagner
Metadata