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

Lookup a top level type referenced from metadata, names should be compared case-sensitively.
private LookupTopLevelMetadataType ( Microsoft.CodeAnalysis.MetadataTypeName &emittedName, bool digThroughForwardedTypes ) : NamedTypeSymbol
emittedName Microsoft.CodeAnalysis.MetadataTypeName /// Full type name with generic name mangling. ///
digThroughForwardedTypes bool /// Take forwarded types into account. ///
Результат NamedTypeSymbol
Пример #1
0
 /// <summary>
 /// Lookup a type defined in referenced assembly.
 /// </summary>
 /// <param name="referencedAssemblyIndex"></param>
 /// <param name="emittedName"></param>
 protected override TypeSymbol LookupTopLevelTypeDefSymbol(
     int referencedAssemblyIndex,
     ref MetadataTypeName emittedName)
 {
     try
     {
         AssemblySymbol assembly = (AssemblySymbol)moduleSymbol.ReferencedAssemblySymbols[referencedAssemblyIndex];
         return(assembly.LookupTopLevelMetadataType(ref emittedName, digThroughForwardedTypes: true));
     }
     catch (Exception e) when(FatalError.Report(e))  // Trying to get more useful Watson dumps.
     {
         throw ExceptionUtilities.Unreachable;
     }
 }
Пример #2
0
        ///// <summary>
        ///// Gets special core type.
        ///// </summary>
        //public CoreType GetSpecialType(SpecialType type)
        //{
        //    CoreType t;
        //    _specialTypes.TryGetValue(type, out t);
        //    return t;
        //}

        internal void Update(AssemblySymbol coreass)
        {
            Contract.ThrowIfNull(coreass);

            foreach (var t in _table.Values)
            {
                if (t.Symbol == null)
                {
                    var fullname = t.FullName;

                    // nested types: todo: in Lookup
                    string nested = null;
                    int    plus   = fullname.IndexOf('+');
                    if (plus > 0)
                    {
                        nested   = fullname.Substring(plus + 1);
                        fullname = fullname.Remove(plus);
                    }

                    var mdname = MetadataTypeName.FromFullName(fullname, false);
                    var symbol = coreass.LookupTopLevelMetadataType(ref mdname, true);
                    if (symbol.IsValidType())
                    {
                        if (nested != null)
                        {
                            symbol = symbol
                                     .GetTypeMembers(nested)
                                     .SingleOrDefault();

                            if (symbol == null)
                            {
                                continue;
                            }
                        }

                        _typetable[symbol] = t;
                        t.Update(symbol);

                        //if (symbol.SpecialType != SpecialType.None)
                        //    _specialTypes[symbol.SpecialType] = t;
                    }
                }
            }
        }
Пример #3
0
        internal void Update(AssemblySymbol coreass)
        {
            Contract.ThrowIfNull(coreass);

            foreach (var t in _table.Values)
            {
                if (t.Symbol == null)
                {
                    var mdname = MetadataTypeName.FromFullName(t.FullName, false);;
                    var symbol = coreass.LookupTopLevelMetadataType(ref mdname, true);
                    if (symbol != null && !symbol.IsErrorType())
                    {
                        _typetable[symbol] = t;
                        t.Update(symbol);

                        if (symbol.SpecialType != SpecialType.None)
                        {
                            _specialTypes[symbol.SpecialType] = t;
                        }
                    }
                }
            }
        }