'Why do C# 7 ValueTuples implement the Equals method but not the double equals operator?

Consider the following code snippet:

var tuple1 = (7, "foo");
var tuple2 = (7, "foo");
var tuple3 = (42, "bar");

Assert.That(tuple1.Equals(tuple2), Is.True);    //This passes
Assert.That(tuple1.Equals(tuple3), Is.False);   //This passes

Assert.That(tuple1 == tuple2, Is.True);         //This does not compile

The first two asserts pass. The third one does not compile.

Why does the ValueTuple implement a custom Equals method but not implement the double equals operator?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source