public override ImmutableArray <NamedTypeSymbol> GetTypeMembers()
 {
     if (_lazyTypeMembers.IsDefault)
     {
         HashSet <NamedTypeSymbol> symbols = new HashSet <NamedTypeSymbol>();
         try
         {
             foreach (var model in _module.Models)
             {
                 foreach (var ms in model.Objects)
                 {
                     if (ms.MParent == null && ms.MId.Descriptor.IsNamedType)
                     {
                         var symbol = MetaSymbolMap.GetNamedTypeSymbol(ms);
                         symbols.Add(symbol);
                     }
                 }
             }
         }
         finally
         {
             ImmutableInterlocked.InterlockedInitialize(ref _lazyTypeMembers, symbols.ToImmutableArray());
         }
     }
     return(_lazyTypeMembers);
 }
Exemplo n.º 2
0
        public override ImmutableArray <NamedTypeSymbol> GetDeclaredBaseTypes(ConsList <TypeSymbol> basesBeingResolved)
        {
            var result = ArrayBuilder <NamedTypeSymbol> .GetInstance();

            foreach (var prop in _metaObject.MProperties.Where(p => p.IsBaseScope))
            {
                foreach (var baseType in (IEnumerable <IModelObject>)_metaObject.MGet(prop))
                {
                    result.Add(MetaSymbolMap.GetNamedTypeSymbol(baseType));
                }
            }
            return(result.ToImmutableAndFree());
        }