์คํผ์ปค:
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!");
์ด์ด์ผ ํฉ๋๋ค.
https://github.com/dotnet/coreclr/pull/13164 ์์ ์ด ์ฌ๋ก๋ฅผ ๋์ณค์ต๋๋ค.
@jkotas ํจ์น ๋ฆด๋ฆฌ์ค์ ๋ํ ์์ ์ฌํญ์ ์ ์ด๋ object
ํ๋ ๋ถ๋ถ์ ์ด์ํ๋๋ก ์์ฒญํ๋ ํ๋ก์ธ์ค๋ ๋ฌด์์
๋๊น? aspnet/Mvc#7673๊ณผ ๊ฐ์ ๊ณ ๊ฐ์ด ๋ณด๊ณ ํ ๋ค์ด์คํธ๋ฆผ ๋ฒ๊ทธ๋ฅผ ๊ฐ์ํ ๋ ์ต์ํ 2.0.x์์๋ ์ด๊ฒ์ด ํ์ํ ๊ฒ ๊ฐ์ต๋๋ค.
/cc @davidfowl @Eilon @Petermarcu
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ตฌ์กฐ์ฒด์ ๋ํ ๊ธฐ๋ณธ
GetHashCode
๊ตฌํ์throw new NotSupportedException("Tomato!");
์ด์ด์ผ ํฉ๋๋ค.