mirror of
https://github.com/golang/go
synced 2024-11-26 18:16:48 -07:00
go/types: update generate_test.go (cleanup)
Adjust some rewrite code to match current code base. Change-Id: I7d3b79b764b95d664dd95e1057725f15a94973d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/519856 Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
parent
e82cb14255
commit
0e9bf41e1d
@ -211,7 +211,7 @@ func fixInferSig(f *ast.File) {
|
||||
ast.Inspect(f, func(n ast.Node) bool {
|
||||
switch n := n.(type) {
|
||||
case *ast.FuncDecl:
|
||||
if n.Name.Name == "infer" || n.Name.Name == "infer1" || n.Name.Name == "infer2" {
|
||||
if n.Name.Name == "infer" {
|
||||
// rewrite (pos token.Pos, ...) to (posn positioner, ...)
|
||||
par := n.Type.Params.List[0]
|
||||
if len(par.Names) == 1 && par.Names[0].Name == "pos" {
|
||||
@ -232,10 +232,8 @@ func fixInferSig(f *ast.File) {
|
||||
n.Args[0] = arg
|
||||
return false
|
||||
}
|
||||
case "errorf", "infer1", "infer2":
|
||||
case "errorf":
|
||||
// rewrite check.errorf(pos, ...) to check.errorf(posn, ...)
|
||||
// rewrite check.infer1(pos, ...) to check.infer1(posn, ...)
|
||||
// rewrite check.infer2(pos, ...) to check.infer2(posn, ...)
|
||||
if ident, _ := n.Args[0].(*ast.Ident); ident != nil && ident.Name == "pos" {
|
||||
pos := n.Args[0].Pos()
|
||||
arg := newIdent(pos, "posn")
|
||||
|
Loading…
Reference in New Issue
Block a user