1 // Copyright 2021 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package p
6
7 type (
8 // 0 and 1-element []-lists are syntactically valid
9 _[A, B /* ERROR missing type constraint */ ] int
10 _[A, /* ERROR type parameters must be named */ interface{}] int
11 _[A, B, C /* ERROR missing type constraint */ ] int
12 _[A B, C /* ERROR missing type constraint */ ] int
13 _[A B, /* ERROR type parameters must be named */ interface{}] int
14 _[A B, /* ERROR type parameters must be named */ interface{}, C D] int
15 _[A B, /* ERROR type parameters must be named */ interface{}, C, D] int
16 _[A B, /* ERROR type parameters must be named */ interface{}, C, interface{}] int
17 _[A B, C interface{}, D, /* ERROR type parameters must be named */ interface{}] int
18 )
19
20 // function type parameters use the same parsing routine - just have a couple of tests
21
22 func _[A, B /* ERROR missing type constraint */ ]() {}
23 func _[A, /* ERROR type parameters must be named */ interface{}]() {}
24
View as plain text