Generics in reflection are indicated by a
backtick followed by the number of generic type parameters.
In the case of your example, that would mean you get the nested type like this:
Type t = Type.GetType("SomeType`1+SomeNestedType");
An easy way to find this sort of information out is to do a little code snippet like this:
public static void Recurse(Type parent)
{
Console.WriteLine(parent.FullName);
Type[] children = parent.GetNestedTypes(BindingFlags.Public | BindingFlags.NonPublic);
foreach(Type child in children)
{
Recurse(child);
}
}
I highly recommend tools like
SnippetCompiler for this sort of little experiment. It makes running tests like this far, far easier.
Anyway, that code will start at a parent type, dump its name to the console, then find all of the nested types and recurse down the nested type tree, dumping names to the console as it goes.
Then all you have to do is start the recursion. For your test case, it looks like this:
Type root = typeof(SomeType<>);
Recurse(root);
You can learn more about how type names are generated by looking on MSDN at articles like this (though, admittedly, this article doesn't currently cover generics):
Specifying Fully Qualified Type Names