Skip to content

Conversation

@Tyrrrz
Copy link
Owner

@Tyrrrz Tyrrrz commented Nov 27, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 27, 2025 15:55
@Tyrrrz Tyrrrz added the enhancement New feature or request label Nov 27, 2025
Copilot finished reviewing on behalf of Tyrrrz November 27, 2025 15:58
Copy link
Contributor

Copilot AI left a comment

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 the Dictionary<TKey, TValue>.TryAdd(TKey key, TValue value) method, which was introduced in .NET Core 2.0. The polyfill enables this functionality for earlier framework versions including .NET Core 1.x, all versions of .NET Framework, and .NET Standard versions prior to 2.1.

  • Implements TryAdd using the check-then-add pattern via ContainsKey and Add
  • Updates the signature documentation and count metadata
  • Enhances the PowerShell signature extraction script to handle generic constraints
  • Provides comprehensive test coverage for both success and failure scenarios

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
PolyShim/NetCore20/Dictionary.cs Adds the TryAdd extension method polyfill with proper generic constraints matching the native API
PolyShim/Signatures.md Documents the new Dictionary.TryAdd member and updates total signature counts
PolyShim/List-Signatures.ps1 Updates regex pattern to correctly parse extension methods with generic where clauses
PolyShim.Tests/NetCore20/DictionaryTests.cs Adds test coverage for TryAdd with scenarios for both new keys and duplicate keys

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

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