private static void Main() { Compilation test = CreateTestCompilation(); foreach (SyntaxTree sourceTree in test.SyntaxTrees) { SemanticModel model = test.GetSemanticModel(sourceTree); TypeInferenceRewriter rewriter = new TypeInferenceRewriter(model); SyntaxNode newSource = rewriter.Visit(sourceTree.GetRoot()); if (newSource != sourceTree.GetRoot()) //File.WriteAllText(sourceTree.FilePath, newSource.ToFullString()); Console.WriteLine(newSource.ToFullString()); } Console.ReadLine(); }
private static void Main() { Compilation test = CreateTestCompilation(); foreach (SyntaxTree sourceTree in test.SyntaxTrees) { SemanticModel model = test.GetSemanticModel(sourceTree); TypeInferenceRewriter rewriter = new TypeInferenceRewriter(model); SyntaxNode newSource = rewriter.Visit(sourceTree.GetRoot()); if (newSource != sourceTree.GetRoot()) { //File.WriteAllText(sourceTree.FilePath, newSource.ToFullString()); Console.WriteLine(newSource.ToFullString()); } } Console.ReadLine(); }