Esempio n. 1
0
 protected override SyntaxNode OnVisitSimpleLambdaExpression(SimpleLambdaExpressionSyntax node)
 {
     SetupReturnType();
     node = (SimpleLambdaExpressionSyntax)base.OnVisitSimpleLambdaExpression(node);
     if (node.GetFunctionBody() is BlockSyntax bodyBlock)
     {
         return(node.WithBody(RewriteFunctionBody(bodyBlock)));
     }
     // TODO: handle arrow methods
     return(node);
 }
Esempio n. 2
0
 public static SimpleLambdaExpressionSyntax Visit(SimpleLambdaExpressionSyntax lambda, SemanticModel semanticModel, CancellationToken cancellationToken)
 {
     return(lambda.WithBody(Visit(lambda.Body, semanticModel, cancellationToken)));
 }