Microsoft.CSharp.RuntimeBinder.Semantics.MethodTypeInferrer.DependsDirectlyOn C# (CSharp) Метод

DependsDirectlyOn() приватный Метод

private DependsDirectlyOn ( int iParam, int jParam ) : bool
iParam int
jParam int
Результат bool
        private bool DependsDirectlyOn(int iParam, int jParam)
        {
            Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.size);
            Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.size);

            // SPEC: An unfixed CType parameter Xi depends directly on an unfixed CType
            // SPEC: parameter Xj if for some argument Ek with CType Tk, Xj occurs
            // SPEC: in an input CType of Ek and Xi occurs in an output CType of Ek
            // SPEC: with CType Tk.

            // We compute and record the Depends Directly On relationship once, in
            // InitializeDependencies, below.

            // At this point, everything should be unfixed.

            Debug.Assert(IsUnfixed(iParam));
            Debug.Assert(IsUnfixed(jParam));

            for (int iArg = 0; iArg < _pMethodArguments.carg; iArg++)
            {
                CType pDest = _pMethodFormalParameterTypes.Item(iArg);
                if (pDest.IsParameterModifierType())
                {
                    pDest = pDest.AsParameterModifierType().GetParameterType();
                }

                EXPR pExpr = _pMethodArguments.prgexpr[iArg];

                if (DoesInputTypeContain(pExpr, pDest,
                        _pMethodTypeParameters.ItemAsTypeParameterType(jParam)) &&
                    DoesOutputTypeContain(pExpr, pDest,
                        _pMethodTypeParameters.ItemAsTypeParameterType(iParam)))
                {
                    return true;
                }
            }
            return false;
        }