示例#1
0
        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();
        }
示例#2
0
        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();
        }