IntelliTect / IntelliTect/CodingGuidelines

Document appropriate implementation of `GetHashCode`.

Đang mở
#8 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
documentation
Ngôn ngữ chính
C#
Star
12
Fork
16
Merge trung bình
2 phút
Pull request đã merge (30 ngày)
7

Mô tả

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`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.