]> Cypherpunks repositories - gostls13.git/commit
go/internal/gcimporter: call Interface.Complete in unified importer
authorMatthew Dempsky <mdempsky@google.com>
Wed, 24 Aug 2022 18:53:42 +0000 (11:53 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 24 Aug 2022 19:39:31 +0000 (19:39 +0000)
commitbdf2db7255565db3d7ca1ffb721203e6d9460ccc
tree708693520b0468ac0fd40f38193d92e68d8ab48c
parent8188bf69f0815f7fdbf6db4b08eb54daec0d006a
go/internal/gcimporter: call Interface.Complete in unified importer

To support concurrent use of the go/types API, importers need to call
Interface.Complete on constructed interfaces before returning.

There's an issue that the interfaces may contain embedded defined
types, whose underlying type isn't known yet. This issue will
eventually go away once CL 424876 lands, but that CL needs to wait for
CL 424854 to re-land, which needs to wait for CL 421879 to land...

In the mean time, this CL implements the same solution used by the
indexed importer: maintaining a list of constructed interfaces, and
calling Interface.Complete on them after the SetUnderlying loop and
just before returning the imported package.

Updates #54653.

Change-Id: I0f42c915a4b7d28c628bbab7ac2eab2415c7858f
Reviewed-on: https://go-review.googlesource.com/c/go/+/425360
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
src/go/internal/gcimporter/ureader.go