Repro:
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");
}
}
Die Standardimplementierung GetHashCode
für Strukturen hätte throw new NotSupportedException("Tomato!");
sein sollen :grin:
https://github.com/dotnet/coreclr/pull/13164 hat diesen Fall verpasst.
@jkotas Wie wird die Portierung mindestens des object
-Feldteils des Fixes auf eine Patch-Version angefordert? Angesichts der von Kunden gemeldeten Downstream-Fehler wie aspnet/Mvc#7673 scheinen wir dies zumindest in 2.0.x zu benötigen.
/cc @davidfowl @Eilon @Petermarcu
Hilfreichster Kommentar
Die Standardimplementierung
GetHashCode
für Strukturen hättethrow new NotSupportedException("Tomato!");
sein sollen :grin: