IntelliTect / IntelliTect/CodingGuidelines
Document appropriate implementation of `GetHashCode`.
Ouverte
documentation
- Langage dominant
- C#
- Étoiles
- 12
- Forks
- 16
- Merge moyen
- 2 min
- PR mergées (30 j)
- 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`
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.