The following code fails to compile:
class MyClass<T> : where T : MyClass <T>{}
Is there any way to solve this?
I have used the following workaround but I was wondering if there is a better way
class MyClass <T> : IMyClass where T : IMyClass {}
interface IMyClass {}
You need to put a colon after the class name only if you want to derive the class from a base class or implement an interface: