private NewInferenceResult FixDependentParameters()
{
// SPEC: All unfixed CType parameters Xi are fixed for which all of the following hold:
// SPEC: There is at least one CType parameter Xj that depends on Xi.
// SPEC: Xi has a non-empty set of bounds.
// As above, we must collect up everything that needs fixing first,
// and then fix them.
bool[] pNeedsFixing = new bool[_pMethodTypeParameters.size];
int iParam;
NewInferenceResult res = NewInferenceResult.NoProgress;
for (iParam = 0; iParam < _pMethodTypeParameters.size; iParam++)
{
if (IsUnfixed(iParam) && HasBound(iParam) && AnyDependsOn(iParam))
{
pNeedsFixing[iParam] = true;
res = NewInferenceResult.MadeProgress;
}
}
for (iParam = 0; iParam < _pMethodTypeParameters.size; iParam++)
{
// Fix as much as you can, even if there are errors. That will
// help with intellisense.
if (pNeedsFixing[iParam])
{
if (!Fix(iParam))
{
res = NewInferenceResult.InferenceFailed;
}
}
}
return res;
}