public static bool GetTypeSymbol()

in dotnet/CSharpSourceGraphExtraction/Utils/RoslynUtils.cs [242:260]


        public static bool GetTypeSymbol(ISymbol symbol, out ITypeSymbol result)
        {
            if (symbol != null
                && !(symbol is IMethodSymbol) && !(symbol is INamespaceOrTypeSymbol)
                && !(symbol is IPreprocessingSymbol) && !(symbol is ITypeSymbol)
                && !(symbol is ILabelSymbol)
                && TypeHierarchy.ComputeTypeForSymbol(symbol, out var typeSym))
            {
                result = typeSym;
                return true;
            }
            else if (symbol is IMethodSymbol methodSymbol)
            {
                result = methodSymbol.ReturnType; // methods' symbols are their return types, for now.
                return true;
            }
            result = null;
            return false;
        }