The use of nested type parameters and recursion (C#)
问题 I am trying to utilize nested parameter types which appears to be illegal. I would prefer to keep the recursive function below intact so that I do not have to duplicate logic. However my nested use of <Ttype> is making the CLR very upset (See Error listed in Code). The logic within MyMethod unavoidably creates delegates of both types Action<ClassA> and Action<ClassB> . Is there a way to alter the code below to accomplish my goal? Also what are the general restrictions concerning the use of