Esempio n. 1
0
        private TableMethodPair ExpandMethodPair(TableMethodPair metPair, MethodTable expMetTable, IGenericReplacer replacer)
        {
            if (metPair == null)
            {
                return(null);
            }

            MethodTable mtable = metPair.Item1;

            if (mtable == this)
            {
                return(new TableMethodPair(expMetTable, metPair.Item2));
            }

            if (mtable.InstGenArgs.IsCollectionValid())
            {
                var genArgs = Helper.ReplaceGenericSigList(mtable.InstGenArgs, replacer);
                mtable = TypeMgr.ResolveMethodTableSpec(mtable.Def, genArgs);

                Debug.Assert(mtable != this);
                return(new TableMethodPair(mtable, metPair.Item2));
            }

            return(metPair);
        }
Esempio n. 2
0
        private void ResolveVTable(TypeManager typeMgr)
        {
            if (VTable != null)
            {
                return;
            }

            MethodTable mtable;

            if (HasGenArgs)
            {
                mtable = typeMgr.ResolveMethodTableSpec(Def, GenArgs);
            }
            else
            {
                mtable = typeMgr.ResolveMethodTableDefRef(Def);
            }

            VTable = new VirtualTable(mtable);
        }