IntelliTect / IntelliTect/CodingGuidelines

Document appropriate implementation of `GetHashCode`.

Abierto
#8 1 comentario 1 reacción 0 asignados Ver en GitHub
documentation
Lenguaje dominante
C#
Estrellas
12
Forks
16
Merge medio
2 min
PR fusionados (30 d)
7

Descripción

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`

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.