]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.typeparams] cmd/compile/internal/types2: use converter functions rather than...
authorRobert Griesemer <gri@golang.org>
Thu, 18 Feb 2021 00:04:59 +0000 (16:04 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 18 Feb 2021 20:47:07 +0000 (20:47 +0000)
commit5e4da8670b13370392a9195930e3b4bbe5f1944f
tree8ba0d44ed463401d3976f9cd3ae6047645e04340
parent5ecb9a788716be799d73c5d8192368ecb9557d48
[dev.typeparams] cmd/compile/internal/types2: use converter functions rather than methods

This change replaces methods with functions to reduce the API surface of
types2.Type and to match the approach taken in go/types. The converter
methods for Named and TypeParam will be addressed in a follow-up CL.

Also: Fixed behavior of optype to return the underlying type for
      arguments that are not type parameters.

Change-Id: Ia369c796754bc33bbaf0c9c8478badecb729279b
Reviewed-on: https://go-review.googlesource.com/c/go/+/293291
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
15 files changed:
src/cmd/compile/internal/importer/support.go
src/cmd/compile/internal/types2/assignments.go
src/cmd/compile/internal/types2/builtins.go
src/cmd/compile/internal/types2/call.go
src/cmd/compile/internal/types2/conversions.go
src/cmd/compile/internal/types2/expr.go
src/cmd/compile/internal/types2/issues_test.go
src/cmd/compile/internal/types2/lookup.go
src/cmd/compile/internal/types2/predicates.go
src/cmd/compile/internal/types2/sizes.go
src/cmd/compile/internal/types2/stdlib_test.go
src/cmd/compile/internal/types2/stmt.go
src/cmd/compile/internal/types2/type.go
src/cmd/compile/internal/types2/typestring.go
src/cmd/compile/internal/types2/typexpr.go