fjgandrade / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

Type.MakeGenericType(params Type[]) only accepts sequential arguments, not an array #285

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In .net, arguments to Type.MakeGenericType(params Type[]) can be passed either 
directly or in an array. The latter variant does not work in SharpKit, however, 
this is the more important (since more flexible) one:

type.MakeGenericType(typeof(type1), typeof(type2)) // works

type.MakeGenericType(new Type[] { typeof(type1), typeof(type2) }) // does not 
work

Invoking the latter variant in SharpKit, the Type[] is added to _TypeArguments 
as a single Type entry, resulting in a wrong generic type definition.

Original issue reported on code.google.com by theo.tig...@googlemail.com on 28 Feb 2013 at 4:50