public class TestClass where T : class { public bool Check (T x, T y) { return x == y; } } public class C { } public class TestClass2 where T : C { public bool Check (T x, T y) { return x == y; } } public class X { public static int Main () { new TestClass ().Check (null, null); new TestClass2 ().Check (null, null); return 0; } }