Base class constraint on generic class specifying the class itself
问题 Yesterday, I was explaining C#'s generic constraints to my friends. When demonstrating the where T : CLASSNAME constraint, I whipped up something like this: public class UnusableClass<T> where T : UnusableClass<T> { public static int method(T input){ return 0; } } And was really surprised to see it compile. After a bit of thinking, however, I figured it was perfectly legal from the point of view of the compiler - UnusableClass<T> is as much of a class as any other that can be used in this