]> Cypherpunks.ru repositories - gostls13.git/commitdiff
go/types, types2: add FileVersions map to test Info
authorRobert Griesemer <gri@golang.org>
Sat, 11 Nov 2023 20:07:25 +0000 (12:07 -0800)
committerGopher Robot <gobot@golang.org>
Mon, 13 Nov 2023 23:23:00 +0000 (23:23 +0000)
Make sure the FileVersions map is populated in test runs.

For #62605.

Change-Id: I06585b5110a4a98b577edb8e03a4981b2484a5a4
Reviewed-on: https://go-review.googlesource.com/c/go/+/541736
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>

src/cmd/compile/internal/types2/check_test.go
src/go/types/check_test.go

index f5c41033596d32ea377c65925a7b864404b24715..a9d6202a336c5aaaf49896546d3cae6c370e53ff 100644 (file)
@@ -197,13 +197,14 @@ func testFilesImpl(t *testing.T, filenames []string, srcs [][]byte, colDelta uin
 
        // Provide Config.Info with all maps so that info recording is tested.
        info := Info{
-               Types:      make(map[syntax.Expr]TypeAndValue),
-               Instances:  make(map[*syntax.Name]Instance),
-               Defs:       make(map[*syntax.Name]Object),
-               Uses:       make(map[*syntax.Name]Object),
-               Implicits:  make(map[syntax.Node]Object),
-               Selections: make(map[*syntax.SelectorExpr]*Selection),
-               Scopes:     make(map[syntax.Node]*Scope),
+               Types:        make(map[syntax.Expr]TypeAndValue),
+               Instances:    make(map[*syntax.Name]Instance),
+               Defs:         make(map[*syntax.Name]Object),
+               Uses:         make(map[*syntax.Name]Object),
+               Implicits:    make(map[syntax.Node]Object),
+               Selections:   make(map[*syntax.SelectorExpr]*Selection),
+               Scopes:       make(map[syntax.Node]*Scope),
+               FileVersions: make(map[*syntax.PosBase]string),
        }
 
        // typecheck
index b0fa131e5da493bfc63f5a9806fc7c3c7500c210..fc9723a67fa5cf4569bb51e55dead7c0d0ed2d6a 100644 (file)
@@ -213,13 +213,14 @@ func testFilesImpl(t *testing.T, filenames []string, srcs [][]byte, manual bool,
 
        // Provide Config.Info with all maps so that info recording is tested.
        info := Info{
-               Types:      make(map[ast.Expr]TypeAndValue),
-               Instances:  make(map[*ast.Ident]Instance),
-               Defs:       make(map[*ast.Ident]Object),
-               Uses:       make(map[*ast.Ident]Object),
-               Implicits:  make(map[ast.Node]Object),
-               Selections: make(map[*ast.SelectorExpr]*Selection),
-               Scopes:     make(map[ast.Node]*Scope),
+               Types:        make(map[ast.Expr]TypeAndValue),
+               Instances:    make(map[*ast.Ident]Instance),
+               Defs:         make(map[*ast.Ident]Object),
+               Uses:         make(map[*ast.Ident]Object),
+               Implicits:    make(map[ast.Node]Object),
+               Selections:   make(map[*ast.SelectorExpr]*Selection),
+               Scopes:       make(map[ast.Node]*Scope),
+               FileVersions: make(map[*ast.File]string),
        }
 
        // typecheck