]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: use types2.Config flag to control Alias node creation
authorRobert Griesemer <gri@golang.org>
Thu, 18 Apr 2024 00:44:55 +0000 (17:44 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 18 Apr 2024 14:10:44 +0000 (14:10 +0000)
commit9101bf19165ecde1967a0163d2fafa168e40ac6d
tree20a5df146ea3ff0c4db8a82818bdcd7f2e256d21
parent334ce510046ad30b1be466634cf313aad3040892
go/types, types2: use types2.Config flag to control Alias node creation

Move Checker.enableAlias to Config.EnableAlias (for types2) and
Config._EnableAlias (for go/types), and adjust all uses.

Use Config.EnableAlias to control Alias creation for types2 and
with that remove dependencies on the gotypesalias GODEBUG setting
and problems during bootstrap. The only client is the compiler and
there we simply use the desired configuration; it is undesirable
for the compiler to be dependent on gotypesalias.

Use the gotypesalias GODEBUG setting to control Config._EnableAlias
for go/types (similar to before).

Adjust some related code. We plan to remove gotypesalias eventually
which will remove some of the new discrepancies between types2 and
go/types again.

Fixes #66874.

Change-Id: Id7cc4805e7ea0697e0d023c7f510867e59a24871
Reviewed-on: https://go-review.googlesource.com/c/go/+/579935
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
16 files changed:
src/cmd/compile/internal/noder/irgen.go
src/cmd/compile/internal/types2/api.go
src/cmd/compile/internal/types2/check.go
src/cmd/compile/internal/types2/check_test.go
src/cmd/compile/internal/types2/decl.go
src/cmd/compile/internal/types2/issues_test.go
src/cmd/compile/internal/types2/object_test.go
src/cmd/compile/internal/types2/resolver.go
src/cmd/compile/internal/types2/typexpr.go
src/go/types/api.go
src/go/types/check.go
src/go/types/decl.go
src/go/types/generate_test.go
src/go/types/object_test.go
src/go/types/resolver.go
src/go/types/typexpr.go