]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: expose types.Info.Inferred with -tags=typeparams
authorRob Findley <rfindley@google.com>
Thu, 6 May 2021 03:03:22 +0000 (23:03 -0400)
committerRobert Findley <rfindley@google.com>
Fri, 7 May 2021 01:42:23 +0000 (01:42 +0000)
commita11a1711b085e5035d42cde49f88bbbab8b36550
tree343f3f75a1e6e0879b6ae35b76d6437289934ab9
parent4dbad795100bc0f5f9419bbb44b1ff0beb60a88c
go/types: expose types.Info.Inferred with -tags=typeparams

Our workaround to get and set types.Info._Inferred makes it harder to
experiment with the new APIs in x/tools.

Instead, just make a copy of the types.Info struct, so that the Inferred
field is accessible when the typeparams build tag is set.

This is a trivially safe change: the only change when not building with
-tags=typeparams is that types.Info._Inferred is removed, and accessing
inferred type information goes through an additional layer of
indirection.

For #46003

Change-Id: I38f2bbb2c80aed28be31d0fe762ccead970476ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/317549
Trust: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/api.go
src/go/types/api_notypeparams.go [new file with mode: 0644]
src/go/types/api_typeparams.go
src/go/types/api_typeparams_test.go
src/go/types/check.go
src/go/types/sanitize.go