This method appears to cache typespecs except in the case of
ElementType.GenericInst but not in the case of ElementType.MVar. This
causes a mismatch for other methods that also have generic type
parameters with different generic names.

My proposed fix is to do:

// don't cache generic instances or generic method parameters
if (ts.Type.ElementType == ElementType.GenericInst ||
    ts.Type.ElementType == ElementType.MVar)
    return CreateTypeSpecFromSig (ts, index, context);

This will then use the GenericContext passed in instead of using the
cached typespec from a previous visited generic method.

-Frank

-- 
--
mono-cecil

Reply via email to