private T GetEnvironment <T>(ISymbol symbol, SyntaxNode node, Dictionary <ISymbol, T> permanentEnvironments, Dictionary <SyntaxNode, T> temporaryEnvironments) { if (permanentEnvironments.TryGetValue(symbol, out var env)) { return(env); } if (temporaryEnvironments.TryGetValue(node, out env)) { return(env); } // external symbol or class member, assume defaults env = (T)Activator.CreateInstance(typeof(T), AreDefaultsSecure, SecurityDiagnosticHelpers.GetTypeSymbol(symbol), node); permanentEnvironments[symbol] = env; return(env); }