How would I go about correcting the example below (which won’t compile)? I’d like to constrain a generic method so that T is always a variant of a generic type. I understand why it might not be possible, but maybe there’s something I don’t know. Thanks for any help!
void DoSomething<T>(T obj) where T: AGenericClass<> {
// Doing Something
}
Alternatively, is there any way to do this?:
void DoSomething(AGenericClass<> obj) {
// Doing Something
}
Thanks!