Por que o ValueType.GetHashCode () é implementado como é?

DeValueType.cs

**Action: Our algorithm for returning the hashcode is a little bit complex. We look 
**        for the first non-static field and get it's hashcode.  If the type has no 
**        non-static fields, we return the hashcode of the type. We can't take the
**        hashcode of a static member because if that member is of the same type as 
**        the original type, we'll end up in an infinite loop.

Fui mordido por isso hoje quando estava usando um KeyValuePair como uma chave em um dicionário (ele armazenava o nome do atributo xml (enum) e seu valor (string)), e esperava que ele tivesse seu código hash calculado com base em todos os seus campos, mas, de acordo com a implementação, considerou apenas a parte principal.

Exemplo (c / p do Linqpad):

void Main()
{
    var kvp1 = new KeyValuePair<string, string>("foo", "bar");
    var kvp2 = new KeyValuePair<string, string>("foo", "baz");

    // true
    (kvp1.GetHashCode() == kvp2.GetHashCode()).Dump();
}

O primeiro campo não estático, eu acho, significa o primeiro campo em ordem de declaração, o que também pode causar problemas ao alterar a ordem das variáveis na fonte por qualquer motivo, e acreditando que ele não altera o código semântica.

questionAnswers(0)

yourAnswerToTheQuestion