public SerializableHierarchy(TypeHierarchy typeHierarchy) { for (int i = 0; i < typeHierarchy._typeDictionary.Count; i++) { types.Add(typeHierarchy._typeDictionary.Get(i)); outgoingEdges.Add(new HashSet <int>(typeHierarchy._typeParents.Values(i))); } }
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); }