]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/types2: disallow lone type parameter on RHS of type declaration
authorRobert Griesemer <gri@golang.org>
Wed, 27 Oct 2021 20:55:15 +0000 (13:55 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 28 Oct 2021 00:11:24 +0000 (00:11 +0000)
commita91d0b649c9ee8c64328fb124eff94dfca300d39
treea0cb94476cfb1bc09c2a806f71aaf36d1c0cb4cb
parent79ff663754f4238bd1fe2e56f460c2f603c71b80
cmd/compile/internal/types2: disallow lone type parameter on RHS of type declaration

We may revisit this decision in a future release. By disallowing this
for Go 1.18 we are ensuring that we don't lock in the generics design
in a place that may need to change later. (Type declarations are the
primary construct where it crucially matters what the underlying type
of a type parameter is.)

Comment out all tests that rely on this feature; add comments referring
to issue so we can find all places easily should we change our minds.

Fixes #45639.

Change-Id: I730510e4da66d3716d455a9071c7778a1e4a1152
Reviewed-on: https://go-review.googlesource.com/c/go/+/359177
Trust: Robert Griesemer <gri@golang.org>
Trust: Dan Scales <danscales@google.com>
Reviewed-by: Dan Scales <danscales@google.com>
20 files changed:
src/cmd/compile/internal/types2/api_test.go
src/cmd/compile/internal/types2/decl.go
src/cmd/compile/internal/types2/testdata/check/linalg.go2
src/cmd/compile/internal/types2/testdata/check/typeinst.go2
src/cmd/compile/internal/types2/testdata/check/typeinst2.go2
src/cmd/compile/internal/types2/testdata/check/typeparams.go2
src/cmd/compile/internal/types2/testdata/examples/methods.go2
src/cmd/compile/internal/types2/testdata/examples/types.go2
src/cmd/compile/internal/types2/testdata/fixedbugs/issue39634.go2
src/cmd/compile/internal/types2/testdata/fixedbugs/issue39768.go2
src/cmd/compile/internal/types2/testdata/fixedbugs/issue39938.go2
src/cmd/compile/internal/types2/testdata/fixedbugs/issue45639.go2
src/cmd/compile/internal/types2/testdata/fixedbugs/issue47747.go2
test/typeparam/absdiff.go
test/typeparam/absdiffimp.dir/a.go
test/typeparam/absdiffimp.dir/main.go
test/typeparam/boundmethod.go
test/typeparam/issue47708.go
test/typeparam/issue47740.go
test/typeparam/issue47740.out