calling Type.MakeGenericType() with null arguments
c#, generics
Solution
Ok I avoided it like this:
var args = typeof(MyType<,,>).GetGenericArguments();
args[2] = typeof(string);
typeof(MyType<,,>).MakeGenericType(args);
Problem
I have a generic type: ``` MyType<T1, T2, T3> ``` and i want to do this: ``` typeof(MyType<,,>).MakeGenericType(new [] { null, null, string}); ``` so i end up with: ``` MyType<,,string> ``` But, you can't pass null types into MakeGenericType (see: http://msdn.microsoft.com/en-us/library/system.type.makegenerictype.aspx). How do I achieve this? Thanks