IntelliTect / IntelliTect/CodingGuidelines
Document appropriate implementation of `GetHashCode`.
- Dominant language
- C#
- Stars
- 12
- Forks
- 16
- Avg merge
- 2m
- Merged PRs (30d)
- 7
Description
VS and Rider both flag warnings when you use a property in a `GetHashCode` implementation that is not read-only, however, I recently encountered an issue where one of the properties was virtual. This allowed the property to change in a derived class and alter the base class hash code leading to a failed dictionary lookup.
Solution: flag as warning when virtual member is used in `GetHashCode`
Contributor guide
Research direction
No files or tests are named in the issue. Locate the repository's existing implementation for warnings involving GetHashCode, then inspect how member mutability and virtual members are analyzed; done means a virtual member used by GetHashCode produces a warning without breaking existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100