public static bool CanObjectOfExtensionBeInferred(
ExpressionBinder binder,
SymbolLoader symbolLoader,
MethodSymbol pMethod,
TypeArray pClassTypeArguments,
TypeArray pMethodFormalParameterTypes,
ArgInfos pMethodArguments)
{
Debug.Assert(pMethod != null);
Debug.Assert(pMethod.typeVars.size > 0);
Debug.Assert(pMethodFormalParameterTypes != null);
Debug.Assert(pMethod.isParamArray || pMethod.Params == pMethodFormalParameterTypes);
// We need at least one formal parameter type and at least one argument.
if (pMethodFormalParameterTypes.size < 1 || pMethod.InferenceMustFail())
{
return false;
}
Debug.Assert(pMethodArguments != null);
Debug.Assert(pMethodArguments.carg <= pMethodFormalParameterTypes.size);
if (pMethodArguments.carg < 1)
{
return false;
}
var inferrer = new MethodTypeInferrer(binder, symbolLoader,
pMethodFormalParameterTypes, pMethodArguments, pMethod.typeVars, pClassTypeArguments);
return inferrer.CanInferExtensionObject();
}