Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update interfaces.md #42657

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Update interfaces.md #42657

merged 1 commit into from
Sep 19, 2024

Conversation

Haidar0096
Copy link
Contributor

@Haidar0096 Haidar0096 commented Sep 18, 2024

This commit makes it more clear the implementing class of the IEquatable<T> method must be of type T in order to be able to determine if its equal to other instances of type T.

Confusion might arise in certain case. For example, if we have a class of type MyClass that implements IEquatable<MyOtherClass>, then we can't use IEquatable's method Equals to compare an instance of MyClass with another instance of MyClass

Summary

Describe your changes here.

Fixes #Issue_Number (if available)


Internal previews

📄 File 🔗 Preview link
docs/csharp/fundamentals/types/interfaces.md docs/csharp/fundamentals/types/interfaces

This commit makes it more clear the implementing class of the `IEquatable<T>` method must be of type `T ` in order to be able to determine if its equal to other instances of type `T`.

Confusion might arise in certain case. For example, if we have a class of type `MyClass` that implements `IEquatable<MyOtherClass>`, then we can't use `IEquatable`'s method `Equals` to compare an instance of `MyClass` with another instance of `MyClass`
@Haidar0096 Haidar0096 requested review from BillWagner and a team as code owners September 18, 2024 20:16
@dotnet-bot dotnet-bot added this to the September 2024 milestone Sep 18, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates PR is created by someone from the .NET community. label Sep 18, 2024
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Haidar0096

This looks great, and I'll :shipit: now.

@BillWagner BillWagner merged commit 8771ec1 into dotnet:main Sep 19, 2024
12 checks passed
@Haidar0096 Haidar0096 deleted the patch-1 branch September 19, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates PR is created by someone from the .NET community. dotnet-csharp/svc fundamentals/subsvc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants