ReferenceEquals always returns false for struct comparison #41839
Labels
dotnet-csharp/svc
fundamentals/subsvc
help wanted
Good for community contributors to help [up-for-grabs]
in-pr
This issue will be closed (fixed) by an active pull request.
Type of issue
Other (describe below)
Description
The article attributes the fact that ReferenceEquals=false to the fact that a structure was copied, however it's not true - it will always return false, even in both examples (in which clearly no copy is involved); so it shouldn't be attributed to the fact of copying, but rather due to boxing ;)
Page URL
https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/how-to-test-for-reference-equality-identity
Content source URL
https://github.com/dotnet/docs/blob/main/docs/csharp/programming-guide/statements-expressions-operators/how-to-test-for-reference-equality-identity.md
Document Version Independent Id
b8e7e74e-d529-2397-a121-2cb7618a6cac
Article author
@BillWagner
Metadata
The text was updated successfully, but these errors were encountered: