...

Source file src/cmd/compile/internal/syntax/testdata/issue43527.go

Documentation: cmd/compile/internal/syntax/testdata

     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 missing type parameter name */ interface{}] int
    11          _[A, B, C /* ERROR missing type constraint */ ] int
    12          _[A B, C /* ERROR missing type constraint */ ] int
    13          _[A B, /* ERROR missing type parameter name */ interface{}] int
    14          _[A B, /* ERROR missing type parameter name */ interface{}, C D] int
    15          _[A B, /* ERROR missing type parameter name */ interface{}, C, D] int
    16          _[A B, /* ERROR missing type parameter name */ interface{}, C, interface{}] int
    17          _[A B, C interface{}, D, /* ERROR missing type parameter name */ 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 missing type parameter name */ interface{}]() {}
    24  

View as plain text