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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With