"Ben Schwehn" wrote:
> >>in framework v2 it's also used for generics
> > Yes, it seems like i have exactly this case. If I understand correctly it
> > is used, e.g., when I have class which extends List<int> to encode the exact
> > type parameters. Do you happen to know how the TypeSpec is encoded in the
> > blob in this case? Just like ELEMENT_TYPE_GENERICINST or some other way?
>
> as far as I know its's either a ELEMENT_TYPE_GENERICINST,
> ELEMENT_TYPE_VAR or ELEMENT_TYPE_MVAR.
> I'm not aware of any other possibilities.
>
> In case you're interested, here's some c# code that produces 3 entries
> in the typespec table, one of each type:
>
> ====
> class GenTest<U>{
> public void Funct(U first, U second) {
> if (first.Equals(second)) {
> }
> }
> public void GenFunct<T>(T first, T second) {
> if (first.Equals(second)) {
> }
> }
> }
> class Program {
> static void Main(string[] args) {
> List<int> testList = new List<int>();
> }
> }
> ===
>
> There's is also the new table 'MethodSpec' used for generic methods.
>
> --
> Ben
>
http://bschwehn.de