This example is a simplification of the real problem, but how can I get this to compile? I would expect the generics constraints to propagate.
Since T is a TClass and TC
The problem is that T doesn't have to be a reference type. Consider:
T
MyClass foo = new MyClass(); MyClass.Func();
That would try to call FuncA but int doesn't obey the : class constraint.
FuncA
int
: class
So basically you need to add the : class constraint to Func as well:
Func
public void Func() where T : class, TClass