Skip to content

Commit

Permalink
Update method-parameters.md (#42684)
Browse files Browse the repository at this point in the history
* Update method-parameters.md

In a sample code, when I pass a value type by reference, if the method assigns the parameter to refer to a different object, those changes are visible from the caller.

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

---------

Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
  • Loading branch information
SousanMovazzaf and BillWagner authored Oct 7, 2024
1 parent 6a64191 commit 18299b4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ How an argument is passed, and whether it's a reference type or value type contr
- If the method assigns the parameter to refer to a different object, those changes **aren't** visible from the caller.
- If the method modifies the state of the object referred to by the parameter, those changes **are** visible from the caller.
- When you pass a *value* type *by reference*:
- If the method assigns the parameter to refer to a different object, those changes **aren't** visible from the caller.
- If the method assigns the parameter to refer to a different object using `ref =`, those changes **aren't** visible from the caller.
- If the method modifies the state of the object referred to by the parameter, those changes **are** visible from the caller.
- When you pass a *reference* type *by reference*:
- If the method assigns the parameter to refer to a different object, those changes **are** visible from the caller.
Expand Down

0 comments on commit 18299b4

Please sign in to comment.