mirror of
https://github.com/golang/go
synced 2024-11-18 16:34:51 -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:
parent
f0d8175b3e
commit
5cf8a6b1aa
@ -10,7 +10,6 @@ import (
|
|||||||
"go/ast"
|
"go/ast"
|
||||||
"go/token"
|
"go/token"
|
||||||
|
|
||||||
"golang.org/x/tools/go/ast/astutil"
|
|
||||||
"golang.org/x/tools/go/exact"
|
"golang.org/x/tools/go/exact"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -608,7 +607,16 @@ func implicitArrayDeref(typ Type) Type {
|
|||||||
return typ
|
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 {
|
func (check *Checker) complexArg(x *operand) bool {
|
||||||
t, _ := x.typ.Underlying().(*Basic)
|
t, _ := x.typ.Underlying().(*Basic)
|
||||||
|
Loading…
Reference in New Issue
Block a user