]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: remove Type.Under method in favor of...
authorRobert Griesemer <gri@golang.org>
Thu, 18 Feb 2021 01:56:34 +0000 (17:56 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 18 Feb 2021 20:47:17 +0000 (20:47 +0000)
commit099374b55e8aed17d1e77a1084f8fb78ff2f8162
treea93d6b9f5cd0c51a25b3072cddba372c85c850c0
parent653386a89a702b54bb01be893cfd30cddb0e6107
[dev.typeparams] cmd/compile/internal/types2: remove Type.Under method in favor of function

This removes the need for the aType embedded type and brings the types2.Type
API in sync with the go/types.Type API.

For reasons not fully understood yet, introducing the new under function
causes a very long initialization cycle error, which doesn't exist in
go/types. For now, circumvent the problem through a helper function variable.

This CL also eliminates superflous (former) Under() method calls
inside optype calls (optype takes care of this).

Plus some minor misc. cleanups and comment adjustments.

Change-Id: I86e13ccf6f0b34d7496240ace61a1c84856b6033
Reviewed-on: https://go-review.googlesource.com/c/go/+/293470
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Robert Griesemer <gri@golang.org>
17 files changed:
src/cmd/compile/internal/importer/support.go
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/conversions.go
src/cmd/compile/internal/types2/decl.go
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/infer.go
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/object.go
src/cmd/compile/internal/types2/operand.go
src/cmd/compile/internal/types2/predicates.go
src/cmd/compile/internal/types2/sizes.go
src/cmd/compile/internal/types2/stmt.go
src/cmd/compile/internal/types2/subst.go
src/cmd/compile/internal/types2/type.go
src/cmd/compile/internal/types2/typexpr.go
src/cmd/compile/internal/types2/unify.go
src/cmd/compile/internal/types2/universe.go