In the C# Language Specification Version 4, 1.6.7.5 Operators is information about List<T> operators: == and !=. But I can’t find such operators defined in List<T>? Am I missing something?
Sample code from 1.6.7.5 Operators:
List<int> a = new List<int>();
a.Add(1);
a.Add(2);
List<int> b = new List<int>();
b.Add(1);
b.Add(2);
Console.WriteLine(a == b); // Outputs "True" => here I get False as well
b.Add(3);
Console.WriteLine(a == b); // Outputs "False"
The spec is indeed correct, although confusing. The spec defines a class called List (poor naming choice).
This class can be seen in the spec at section 1.6.7. The Equals operator is overloaded and matches the output explained above. Perhaps a better name should have been chosen for that class.