public static bool Infer(
ExpressionBinder binder,
SymbolLoader symbolLoader,
MethodSymbol pMethod,
TypeArray pClassTypeArguments,
TypeArray pMethodFormalParameterTypes,
ArgInfos pMethodArguments,
out TypeArray ppInferredTypeArguments)
{
Debug.Assert(pMethod != null);
Debug.Assert(pMethod.typeVars.size > 0);
Debug.Assert(pMethod.isParamArray || pMethod.Params == pMethodFormalParameterTypes);
ppInferredTypeArguments = null;
if (pMethodFormalParameterTypes.size == 0 || pMethod.InferenceMustFail())
{
return false;
}
Debug.Assert(pMethodArguments != null);
Debug.Assert(pMethodFormalParameterTypes != null);
Debug.Assert(pMethodArguments.carg <= pMethodFormalParameterTypes.size);
var inferrer = new MethodTypeInferrer(binder, symbolLoader,
pMethodFormalParameterTypes, pMethodArguments,
pMethod.typeVars, pClassTypeArguments);
bool success;
if (pMethodArguments.fHasExprs)
{
success = inferrer.InferTypeArgs();
}
else
{
success = inferrer.InferForMethodGroupConversion();
}
ppInferredTypeArguments = inferrer.GetResults();
return success;
}