扬声器:
using System;
struct StructWithDoubleField
{
public double value;
}
class My {
static void Main() {
StructWithDoubleField s1;
s1.value = 0.0;
StructWithDoubleField s2;
s2.value = -0.0;
Console.WriteLine(s1.GetHashCode() == s2.GetHashCode() ? "PASSED" : "FAILED");
}
}
结构的默认GetHashCode
实现应该是throw new NotSupportedException("Tomato!");
:grin:
@jkotas请求至少将修复的object
字段部分移植到补丁版本的过程是什么? 鉴于客户报告的下游错误(例如 aspnet/Mvc#7673),似乎我们至少在 2.0.x 中需要这个。
/cc @davidfowl @Eilon @Petermarcu
最有用的评论
结构的默认
GetHashCode
实现应该是throw new NotSupportedException("Tomato!");
:grin: