// Compiler options: -langversion:future using System; interface IContravariant { } interface ICovariant { } class D { public static bool Contra (IContravariant e1, IContravariant e2) { Console.WriteLine (typeof (T)); return typeof (T) == typeof (string); } public static bool Covariant (ICovariant e1, ICovariant e2) { Console.WriteLine (typeof (T)); return typeof (T) == typeof (object); } public static int Main () { ICovariant a = null; ICovariant b = null; if (!Covariant (a, b)) return 1; IContravariant a_1 = null; IContravariant b_1 = null; if (!Contra (a_1, b_1)) return 2; return 0; } }