using System; using System.Runtime.InteropServices; public class Simple { public static void Gen() { Simple.Gen (); } public T t; } public class Generic where B : class where C : struct where D : new() where E : class, new() { } public interface A {} public interface Z {} public class TypeWithConstraints where T : A, IComparable, IComparable, Z { } public class Driver { public void GenericMethod () where B : class where C : struct where D : new() where E : class, new() { } public static void Main () { var x = new Simple (); var y = x.t; Simple.Gen (); Simple.Gen (); } }