IntelliTect / IntelliTect/CodingGuidelines

Document appropriate implementation of `GetHashCode`.

未关闭
#8 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
documentation
主要语言
C#
星标
12
派生
16
平均合并
2 分钟
30 天内合并 PR
7

描述

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`

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。