public static void TestArrayTypeAlias() { IFoo <IBar[]> foo = new G1 <IBar[]>(); Assert.AreEqual(1, foo.Foo(null)); IFoo <string> foo1 = new G2(); Assert.AreEqual(2, foo1.Foo(null)); var g3 = new G3(); IEquatable <IBar[]> ibar = g3; IEquatable <string[]> istr = g3; g3.tracker = 0; g3.Equals(new IBar[0]); Assert.AreEqual(1, g3.tracker); g3.tracker = 0; ibar.Equals(new IBar[0]); Assert.AreEqual(1, g3.tracker); g3.tracker = 0; istr.Equals(new string[0]); Assert.AreEqual(2, g3.tracker); }
public static void Main() { G <C> .Foo(); G2 <C> .Foo(); }