aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-07-12 22:39:39 -0700
committerRobert Griesemer <gri@golang.org>2021-07-14 23:33:52 +0000
commit4ff0e04c2e409aaeebe0cf5287dbed735f84e974 (patch)
treee2d67f5e15c375721fadeaef5fd34e6e9c0ba9b8 /test
parent3a047326e896302724378e5d6b8684851ccfdbfd (diff)
downloadgo-4ff0e04c2e409aaeebe0cf5287dbed735f84e974.tar.gz
go-4ff0e04c2e409aaeebe0cf5287dbed735f84e974.zip
[dev.typeparams] cmd/compile/internal/types2: embedding stand-alone type parameters is not permitted
For #47127. Change-Id: Ie979ff56ae7c2dd0e5ce0ff39588f98ae68b5ee9 Reviewed-on: https://go-review.googlesource.com/c/go/+/334151 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 'test')
-rw-r--r--test/typeparam/typelist.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/typeparam/typelist.go b/test/typeparam/typelist.go
index bd90d86fcf..5c51c9c461 100644
--- a/test/typeparam/typelist.go
+++ b/test/typeparam/typelist.go
@@ -67,6 +67,8 @@ func _[V any, T interface { type map[string]V }](p T) V {
// Testing partial and full type inference, including the case where the types can
// be inferred without needing the types of the function arguments.
+// Cannot embed stand-alone type parameters. Disabled for now.
+/*
func f0[A any, B interface{type C}, C interface{type D}, D interface{type A}](A, B, C, D)
func _() {
f := f0[string]
@@ -82,6 +84,7 @@ func _() {
f(0, 0)
f1(0, 0)
}
+*/
func f2[A any, B interface{type []A}](_ A, _ B)
func _() {
@@ -92,6 +95,8 @@ func _() {
// f2(0, []byte{}) - this one doesn't work
}
+// Cannot embed stand-alone type parameters. Disabled for now.
+/*
func f3[A any, B interface{type C}, C interface{type *A}](a A, _ B, c C)
func _() {
f := f3[int]
@@ -99,6 +104,7 @@ func _() {
f(x, &x, &x)
f3(x, &x, &x)
}
+*/
func f4[A any, B interface{type []C}, C interface{type *A}](_ A, _ B, c C)
func _() {