• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5package p
6
7type (
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
22func _[A, B /* ERROR missing type constraint */ ]() {}
23func _[A, /* ERROR missing type parameter name */ interface{}]() {}
24