コード例 #1
0
 protected override SyntaxNode OnVisitLocalFunctionStatement(LocalFunctionStatementSyntax node)
 {
     _retunTypeSyntax = !_methodResult.Symbol.ReturnsVoid ? node.ReturnType : null;
     if (!_methodResult.Faulted &&
         (
             (_methodResult.Symbol.ReturnsVoid && node.IsReturnStatementRequired()) ||
             _methodResult.WrapInTryCatch
         )
         )
     {
         node = node.ConvertExpressionBodyToBlock(_transformResult);
     }
     node = (LocalFunctionStatementSyntax)base.OnVisitLocalFunctionStatement(node);
     if (node.GetFunctionBody() is BlockSyntax bodyBlock)
     {
         return(node.WithBody(RewriteFunctionBody(bodyBlock)));
     }
     // TODO: handle arrow methods
     return(node);
 }