summaryrefslogtreecommitdiffstats
path: root/src/cmd/compile/internal/syntax/testdata/tparams.go2
blob: a9bd72cf2d97c39ed2d6a80e4392a295d2b69b37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// 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[a, b /* ERROR missing type constraint */ ] struct{}
type t[a t, b t, c /* ERROR missing type constraint */ ] struct{}
type t struct {
	t [n]byte
	t[a]
	t[a, b]
}
type t interface {
	t[a]
	m /* ERROR method must have no type parameters */ [_ _, /* ERROR mixed */ _]()
	t[a, b]
}

func f[ /* ERROR empty type parameter list */ ]()
func f[a, b /* ERROR missing type constraint */ ]()
func f[a t, b t, c /* ERROR missing type constraint */ ]()

func f[a b,  /* ERROR expecting ] */ 0] ()