From 7ec34ffe0ceef9b17a0ca243dc9c140419ca7cc2 Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Wed, 4 Sep 2024 09:13:59 +0200 Subject: [PATCH] add comment --- src/go/parser/parser.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/go/parser/parser.go b/src/go/parser/parser.go index 26b9630cfc..3f2297c194 100644 --- a/src/go/parser/parser.go +++ b/src/go/parser/parser.go @@ -2695,6 +2695,9 @@ func extractName(x ast.Expr, force bool) (*ast.Ident, ast.Expr) { case *ast.CallExpr: if name, _ := x.Fun.(*ast.Ident); name != nil { if len(x.Args) == 1 && x.Ellipsis == token.NoPos && (force || isTypeElem(x.Args[0])) { + // x = name (x.Args[0]) + // (Note that the cmd/compile/internal/syntax parser does not care + // about syntax tree fidelity and does not preserve parentheses here.) return name, &ast.ParenExpr{ Lparen: x.Lparen, X: x.Args[0],