mutable elements in HashSet

Open Beginner friendly
#1,302 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
documentation

Research direction

Start with xml/System.Collections.Generic/HashSet`1.xml, specifically the HashSet remarks, and compare the existing Dictionary<TKey,TValue> caveat. Update the HashSet documentation to explain the effect of mutating an element on its hash value and equality, then verify the generated API reference contains the new guidance.

Written by the indexing model from the issue text.

Description

area-System.Collections dotnet-api/prod Pri2 untriaged

It appears the documentation for HashSet should include the same caveat as Dictionary: As long as an object is used as a key in the Dictionary<TKey,TValue>, it must not change in any way that affects its hash value. Every key in a Dictionary<TKey,TValue> must be unique according to the dictionary's equality comparer.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: 6b66ab1a-35aa-1bba-388c-30d698c1f50c
  • Version Independent ID: d7dde1b9-fd16-dd30-6622-a15836579a9c
  • Content: HashSet<T> Class (System.Collections.Generic)
  • Content Source: [xml/System.Collections.Generic/HashSet1.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Collections.Generic/HashSet1.xml)
  • Product: dotnet-api
  • GitHub Login: @mairaw
  • Microsoft Alias: mairaw
Dominant language
C#
Stars
950
Forks
1.7k
Avg merge
3d 5h
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/dotnet-api-docs

All issues in dotnet/dotnet-api-docs

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.