Text file src/cmd/compile/internal/syntax/testdata/tparams.go2

     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.
     4  
     5  package p
     6  
     7  type t[a, b /* ERROR missing type constraint */ ] struct{}
     8  type t[a t, b t, c /* ERROR missing type constraint */ ] struct{}
     9  type t struct {
    10  	t [n]byte
    11  	t[a]
    12  	t[a, b]
    13  }
    14  type t interface {
    15  	t[a]
    16  	m /* ERROR method must have no type parameters */ [_ _, /* ERROR mixed */ _]()
    17  	t[a, b]
    18  }
    19  
    20  func f[ /* ERROR empty type parameter list */ ]()
    21  func f[a, b /* ERROR missing type constraint */ ]()
    22  func f[a t, b t, c /* ERROR missing type constraint */ ]()
    23  
    24  func f[a b,  /* ERROR expecting ] */ 0] ()
    25  

View as plain text