Skip to content

Commit

Permalink
go/loader: Initialize (types/Info).Instances field
Browse files Browse the repository at this point in the history
Initialize the Instances field of PackageInfo.Info during importing.

Needed for go/ssa and similar users.

Updates golang/go#48525

Change-Id: Ibacf925e677ec6e90068b90a4f381d96c22338cc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/385774
Run-TryBot: Tim King <taking@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
  • Loading branch information
timothy-king committed Feb 15, 2022
1 parent be40034 commit 33002ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (

"golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/internal/cgo"
"golang.org/x/tools/internal/typeparams"
)

var ignoreVendor build.ImportMode
Expand Down Expand Up @@ -1053,6 +1054,7 @@ func (imp *importer) newPackageInfo(path, dir string) *PackageInfo {
errorFunc: imp.conf.TypeChecker.Error,
dir: dir,
}
typeparams.InitInstanceInfo(&info.Info)

// Copy the types.Config so we can vary it across PackageInfos.
tc := imp.conf.TypeChecker
Expand Down

0 comments on commit 33002ea

Please sign in to comment.