Got it working, here is my code:
public static TypeReference GetReturnType(this MethodReference
self)
{
TypeReference returnType = self.ReturnType;
if (returnType.IsGenericParameter)
{
GenericParameter tmp = (GenericParameter)returnType;
GenericInstanceType owner = tmp.Owner as
GenericInstanceType;
if (owner != null)
returnType = owner.GenericArguments[tmp.Position];
else
returnType =
((GenericInstanceMethod)self).GenericArguments[tmp.Position];
}
return returnType;
}Jan -- -- mono-cecil
