Is it possible to have a generic type parameter that requires a type parameter?
i.e.
public abstract class ClassA<T>
{}
public class ClassB<T>:ClassA<T>
{}
...
public void MethodA<T>() where T:ClassA, new()
{
T<string> x=new T<string>();
}
...
MethodA<ClassB>();
This produces an error because ClassB requires a type parameter on the last line.
Is there a missing piece of syntax I can use that will make this work?
(Side note, This question is largely theoretical since I can probably achieve what I want without the above but the above would certainly make things cleaner in the user-side code, though probably messier inside MethodA since reflection will almost certainly come in to play at some point)