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)); }
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)); }