1 // Copyright 2020 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.
7 type _[a, b] /* ERROR "missing type constraint" */ struct{}
8 type _[a t, b t, c] /* ERROR "missing type constraint" */ struct{}
17 t [n, /* ERROR "unexpected comma; expecting ]" */ ]byte
22 m[ /* ERROR "method must have no type parameters" */ _ _, /* ERROR mixed */ _]()
27 func _[] /* ERROR "empty type parameter list" */ ()
28 func _[a, b ] /* ERROR "missing type constraint" */ ()
29 func _[a t, b t, c] /* ERROR "missing type constraint" */ ()
31 // TODO(rfindley) incorrect error message (see existing TODO in parser)
32 func f[a b, 0 /* ERROR "expected '\)', found 0" */ ] ()
38 _[a *t|[]int] struct{}
41 _[a *struct{}|t] struct{}
42 _[a *t|struct{}] struct{}
43 _[a *struct{}|~t] struct{}
49 _[a *t|t, b t] struct{}
61 _ [t /* ERROR "missing type parameter name or invalid array length" */ [t]]struct{}
62 _ [t t[t], t /* ERROR "missing type parameter name" */ [t]]struct{}
63 _ [t /* ERROR "missing type parameter name" */ [t], t t[t]]struct{}
64 _ [t /* ERROR "missing type parameter name" */ [t], t[t]]struct{} // report only first error