mirror of https://github.com/golang/go.git
add comment
This commit is contained in:
parent
9162984fe9
commit
7ec34ffe0c
|
|
@ -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],
|
||||
|
|
|
|||
Loading…
Reference in New Issue