Repository navigation
[Frozen] Document duplicate handling in summaries of all FrozenDictionary factory methods - #134318
Open
priyadarshnisundararajan wants to merge 2 commits into
Conversation
…nary factory methods The three KVP-based factories documented last-duplicate-wins only in remarks (invisible to IntelliSense tooltips); the two key/element selector overloads documented nothing despite throwing ArgumentException on duplicates. State both in summary. Signed-off-by: Priyadarshni Sundararajan <priyadarshnisundararajan@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-collections |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
priyadarshnisundararajan
marked this pull request as ready for review
September 21, 2026 04:50
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
@priyadarshnisundararajan Thanks for picking this up and for the credit; please go ahead with it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #127798 (documentation half only — no behavior change; behavioral alignment stays deferred to #113096).
Problem
The three key/value pair-based factories (
Createx2,ToFrozenDictionary(IEnumerable<KeyValuePair<TKey, TValue>>)) document their last-duplicate-wins behavior only in<remarks>, which does not show up in IntelliSense tooltips, while the two key/element selector overloads document nothing at all even though they throwArgumentExceptionon duplicates (inherited fromEnumerable.ToDictionary). Callers switching source types get caught off-guard by the difference.Change (docs only)
<summary>: "If the same key appears multiple times in the input, the latter one in the sequence takes precedence." (The existing<remarks>text is left unchanged.)<summary>that they throwArgumentExceptionifkeySelectorproduces duplicate keys, contrasting with the KVP-based overloads.Testing
Note: @caraioniurie47 posted a full analysis in the thread on 2026-09-11 offering to send this PR; opening it now as none materialized — happy to hand it over if you'd rather take it.