Пример #1
0
        private static SyntaxNode FixReturnType(SyntaxNode node, SyntaxNode newNode, SemanticModel model, Scope scope)
        {
            var method = (MethodDeclarationSyntax)node;
            var type   = RoslynCompiler.GetReturnType(method.Body, model);

            return((newNode as MethodDeclarationSyntax)
                   .WithReturnType(type));
        }
Пример #2
0
        private static SyntaxNode CalculateReturnType(SyntaxNode node, SyntaxNode newNode, SemanticModel model, Scope scope)
        {
            var method = node as MethodDeclarationSyntax;

            if (method == null)
            {
                return(node);
            }

            var type = RoslynCompiler.GetReturnType(method.Body, model);

            return((newNode as MethodDeclarationSyntax)
                   .WithReturnType(type));
        }