Skip to content

Add polyfill for EqualityComparer<T>.Create(...)#49

Merged
Tyrrrz merged 3 commits into
masterfrom
equalitycomparer-create
Nov 27, 2025
Merged

Add polyfill for EqualityComparer<T>.Create(...)#49
Tyrrrz merged 3 commits into
masterfrom
equalitycomparer-create

Conversation

@Tyrrrz

@Tyrrrz Tyrrrz commented Nov 27, 2025

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings November 27, 2025 15:17
@Tyrrrz Tyrrrz added the enhancement New feature or request label Nov 27, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a polyfill for EqualityComparer<T>.Create(...) method introduced in .NET 8.0, allowing projects targeting older .NET versions to use this modern API.

  • Implements EqualityComparer<T>.Create() static method that accepts custom equality and hash code functions
  • Adds comprehensive test coverage for the new polyfill including edge cases
  • Updates documentation to reflect the new signature

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
PolyShim/Signatures.md Updates signature counts and adds entry for EqualityComparer<T>.Create()
PolyShim/Net80/EqualityComparer.cs Implements the polyfill using a private DelegateEqualityComparer<T> class with primary constructor syntax
PolyShim.Tests/Net80/EqualityComparerTests.cs Adds test coverage for the Create method with and without hash code function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread PolyShim.Tests/Net80/EqualityComparerTests.cs Outdated
Comment thread PolyShim.Tests/Net80/EqualityComparerTests.cs Outdated
Tyrrrz and others added 2 commits November 27, 2025 17:20
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants