aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/syntax/testdata/tparams.go2
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/syntax/testdata/tparams.go2')
-rw-r--r--src/cmd/compile/internal/syntax/testdata/tparams.go222
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/syntax/testdata/tparams.go2 b/src/cmd/compile/internal/syntax/testdata/tparams.go2
new file mode 100644
index 0000000000..42031c3277
--- /dev/null
+++ b/src/cmd/compile/internal/syntax/testdata/tparams.go2
@@ -0,0 +1,22 @@
+// Copyright 2020 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type t[ /* ERROR type parameters must be named */ a, b] struct{}
+type t[a t, b t, /* ERROR type parameters must be named */ c] struct{}
+type t struct {
+ t [n]byte
+ t[a]
+ t[a, b]
+}
+type t interface {
+ t[a]
+ m /* ERROR method cannot have type parameters */ [_ _, /* ERROR mixed */ _]()
+ t[a, b]
+}
+
+func f[ /* ERROR empty type parameter list */ ]()
+func f[ /* ERROR type parameters must be named */ a, b]()
+func f[a t, b t, /* ERROR type parameters must be named */ c]()