internal static TypeReference ResolveParameterTypeIfNeeded(MethodReference method, ParameterReference parameter)
{
var genericInstanceMethod = method as GenericInstanceMethod;
var declaringGenericInstanceType = method.DeclaringType as GenericInstanceType;
if (genericInstanceMethod == null && declaringGenericInstanceType == null)
return parameter.ParameterType;
return ResolveIfNeeded (genericInstanceMethod, declaringGenericInstanceType, parameter.ParameterType);
}