aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/testdata
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-07-26 12:13:45 -0700
committerRobert Griesemer <gri@golang.org>2021-07-26 20:53:17 +0000
commit37d2219960340614f4d7e67c2e620013594e131a (patch)
treedecd8d783ed931343c58b3d69e18c2b912b86f0b /src/cmd/compile/internal/types2/testdata
parentd6753fd491c101e71f5e86d87b44d396828e2deb (diff)
downloadgo-37d2219960340614f4d7e67c2e620013594e131a.tar.gz
go-37d2219960340614f4d7e67c2e620013594e131a.zip
[dev.typeparams] cmd/compile/internal/types2: embedded type cannot be a (pointer to) a type parameter
Change-Id: I5eb03ae349925f0799dd866e207221429bc9fb3c Reviewed-on: https://go-review.googlesource.com/c/go/+/337353 Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/testdata')
-rw-r--r--src/cmd/compile/internal/types2/testdata/check/typeparams.go24
-rw-r--r--src/cmd/compile/internal/types2/testdata/fixedbugs/issue39938.go24
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/types2/testdata/check/typeparams.go2 b/src/cmd/compile/internal/types2/testdata/check/typeparams.go2
index 2755a539e5..54efd1485b 100644
--- a/src/cmd/compile/internal/types2/testdata/check/typeparams.go2
+++ b/src/cmd/compile/internal/types2/testdata/check/typeparams.go2
@@ -79,11 +79,11 @@ var _ *int = new[int]()
func _[T any](map[T /* ERROR invalid map key type T \(missing comparable constraint\) */]int) // w/o constraint we don't know if T is comparable
-func f1[T1 any](struct{T1}) int
+func f1[T1 any](struct{T1 /* ERROR cannot be a .* type parameter */ }) int
var _ = f1[int](struct{T1}{})
type T1 = int
-func f2[t1 any](struct{t1; x float32}) int
+func f2[t1 any](struct{t1 /* ERROR cannot be a .* type parameter */ ; x float32}) int
var _ = f2[t1](struct{t1; x float32}{})
type t1 = int
diff --git a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39938.go2 b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39938.go2
index 76e7e369ca..0da6e103fd 100644
--- a/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39938.go2
+++ b/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39938.go2
@@ -8,8 +8,8 @@ package p
type E0[P any] P
type E1[P any] *P
-type E2[P any] struct{ P }
-type E3[P any] struct{ *P }
+type E2[P any] struct{ _ P }
+type E3[P any] struct{ _ *P }
type T0 /* ERROR illegal cycle */ struct {
_ E0[T0]