1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:44:43 -07:00

go/types: remove dependency on go/ast/astutil

This package was only imported for the trivial Unparen function.

Change-Id: I14f8d91bc0afaa6ab3aa797a53e42e56b59ffcbe
Reviewed-on: https://go-review.googlesource.com/8499
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Robert Griesemer 2015-04-06 12:29:37 -07:00
parent f0d8175b3e
commit 5cf8a6b1aa

View File

@ -10,7 +10,6 @@ import (
"go/ast"
"go/token"
"golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/exact"
)
@ -608,7 +607,16 @@ func implicitArrayDeref(typ Type) Type {
return typ
}
func unparen(x ast.Expr) ast.Expr { return astutil.Unparen(x) }
// unparen returns e with any enclosing parentheses stripped.
func unparen(e ast.Expr) ast.Expr {
for {
p, ok := e.(*ast.ParenExpr)
if !ok {
return e
}
e = p.X
}
}
func (check *Checker) complexArg(x *operand) bool {
t, _ := x.typ.Underlying().(*Basic)