IntelliTect / IntelliTect/CodingGuidelines

Document appropriate implementation of `GetHashCode`.

オープン
#8 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
documentation
主要言語
C#
スター
12
フォーク
16
平均マージ
2分
マージ済み PR(30日)
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 を短くまとめたダイジェスト。