Microsoft.CSharp.RuntimeBinder.SymbolTable.GetSlotForOverride C# (CSharp) Méthode

GetSlotForOverride() private méthode

private GetSlotForOverride ( MethodInfo method ) : SymWithType
method System.Reflection.MethodInfo
Résultat Microsoft.CSharp.RuntimeBinder.Semantics.SymWithType
        private SymWithType GetSlotForOverride(MethodInfo method)
        {
            if (method.IsVirtual && method.IsHideBySig)
            {
                MethodInfo baseMethodInfo = method.GetRuntimeBaseDefinition();
                if (baseMethodInfo == method)
                {
                    // We just found ourselves, so we don't care here.
                    return null;
                }

                // We have the base class method that we're overriding. We can assume
                // that all the parent aggregate symbols were added, and that we added
                // the methods in order. As such, our parent methods should be in the 
                // symbol table at this point.

                AggregateSymbol aggregate = GetCTypeFromType(baseMethodInfo.DeclaringType).getAggregate();
                MethodSymbol baseMethod = FindMethodFromMemberInfo(baseMethodInfo);

                // This assert is temporarily disabled to improve testability of the area on .NetNative
                //Debug.Assert(baseMethod != null);
                if ((object)baseMethod == null)
                {
                    throw Error.InternalCompilerError();
                }

                return new SymWithType(baseMethod, aggregate.getThisType());
            }
            return null;
        }