]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/go/types/generate_test.go
go/types, types2: remove local version processing in favor of go/version
[gostls13.git] / src / go / types / generate_test.go
index 7f338270aafbcfc80d4aa4f4bc970306fcea9d48..e74a1e6f2566462a08d6114379aa894404a93869 100644 (file)
@@ -95,6 +95,7 @@ func generate(t *testing.T, filename string, write bool) {
 type action func(in *ast.File)
 
 var filemap = map[string]action{
+       "alias.go":        nil,
        "array.go":        nil,
        "basic.go":        nil,
        "chan.go":         nil,
@@ -102,6 +103,7 @@ var filemap = map[string]action{
        "context.go":      nil,
        "context_test.go": nil,
        "gccgosizes.go":   nil,
+       "gcsizes.go":      func(f *ast.File) { renameIdent(f, "IsSyncAtomicAlign64", "_IsSyncAtomicAlign64") },
        "hilbert_test.go": func(f *ast.File) { renameImportPath(f, `"cmd/compile/internal/types2"`, `"go/types"`) },
        "infer.go": func(f *ast.File) {
                fixTokenPos(f)
@@ -141,7 +143,6 @@ var filemap = map[string]action{
        "universe.go":      fixGlobalTypVarDecl,
        "util_test.go":     fixTokenPos,
        "validtype.go":     nil,
-       "version_test.go":  nil,
 }
 
 // TODO(gri) We should be able to make these rewriters more configurable/composable.
@@ -240,6 +241,14 @@ func fixInferSig(f *ast.File) {
                                                n.Args[0] = arg
                                                return false
                                        }
+                               case "allowVersion":
+                                       // rewrite check.allowVersion(..., pos, ...) to check.allowVersion(..., posn, ...)
+                                       if ident, _ := n.Args[1].(*ast.Ident); ident != nil && ident.Name == "pos" {
+                                               pos := n.Args[1].Pos()
+                                               arg := newIdent(pos, "posn")
+                                               n.Args[1] = arg
+                                               return false
+                                       }
                                }
                        }
                }