static void Main(string[] args) { var covariantList = new CovariantList <C1, C2, C3>(); covariantList.Add(new C3()); Test1(covariantList); Test2(covariantList); Test3(covariantList); Test4(covariantList); Test5(covariantList); Test6(covariantList); Test7((List <C3>)covariantList); Test7(new List <C3>()); covariantList.Add(new C3()); Test1(covariantList); List <C3> list = covariantList; list.Add(new C3()); Test1(covariantList); Console.ReadLine(); }
private static void Test7(CovariantList <C2, C2, C3> c) { Console.WriteLine("Test7 Count: " + c.Count); }