Esempio n. 1
0
        private bool DefinitionExistsInPreviousGeneration(ISymbolInternal symbol)
        {
            var definition = (IDefinition)symbol.GetCciAdapter();

            if (!_definitionMap.DefinitionExists(definition))
            {
                return(false);
            }

            // Definition map does not consider types that are being replaced,
            // hence we need to check - type that is being replaced is not considered
            // existing in the previous generation.
            var current = symbol.GetISymbol();

            do
            {
                if (_replacedSymbols.Contains(current))
                {
                    return(false);
                }

                current = current.ContainingType;
            }while (current is not null);

            return(true);
        }
Esempio n. 2
0
        public ISymbolInternal?MapDefinitionOrNamespace(ISymbolInternal symbol)
        {
            var adapter = symbol.GetCciAdapter();

            return((adapter is Cci.IDefinition definition) ?
                   MapDefinition(definition)?.GetInternalSymbol() :
                   MapNamespace((Cci.INamespace)adapter)?.GetInternalSymbol());
        }