forked from golang/go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypeset.go2
More file actions
75 lines (63 loc) · 2.56 KB
/
typeset.go2
File metadata and controls
75 lines (63 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Copyright 2021 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.
// This file contains test cases for typeset-only constraint elements.
// TODO(gri) gofmt once/if gofmt supports this notation.
package p
type (
_[_ t] t
_[_ ~t] t
_[_ t|t] t
_[_ ~t|t] t
_[_ t|~t] t
_[_ ~t|~t] t
_[_ t, _, _ t|t] t
_[_ t, _, _ ~t|t] t
_[_ t, _, _ t|~t] t
_[_ t, _, _ ~t|~t] t
_[_ t.t] t
_[_ ~t.t] t
_[_ t.t|t.t] t
_[_ ~t.t|t.t] t
_[_ t.t|~t.t] t
_[_ ~t.t|~t.t] t
_[_ t, _, _ t.t|t.t] t
_[_ t, _, _ ~t.t|t.t] t
_[_ t, _, _ t.t|~t.t] t
_[_ t, _, _ ~t.t|~t.t] t
_[_ struct{}] t
_[_ ~struct{}] t
_[_ struct{}|t] t
_[_ ~struct{}|t] t
_[_ struct{}|~t] t
_[_ ~struct{}|~t] t
_[_ t|struct{}] t
_[_ ~t|struct{}] t
_[_ t|~struct{}] t
_[_ ~t|~struct{}] t
)
// Single-expression type parameter lists and those that don't start
// with a (type parameter) name are considered array sizes.
// The term must be a valid expression (it could be a type - and then
// a type-checker will complain - but we don't allow ~ in the expr).
// TODO(rfindley): Improve error recover here. In these cases go/parser error
// recovery is worse than cmd/compile/internal/syntax, and unnecessary type
// declarations had to be inserted to force synchronization.
type _[t] t
type _[~ /* ERROR "expected operand" */ t] t
type /* ERROR "expected ']'" */ Sync int // placeholder to synchronize the parser
type _[t|t] t
type _[~ /* ERROR "expected operand" */ t|t] t
type /* ERROR "expected ']'" */ Sync int // placeholder to synchronize the parser
type _[t| ~ /* ERROR "expected operand" */ t] t
type /* ERROR "expected ']'" */ Sync int // placeholder to synchronize the parser
type _[~ /* ERROR "expected operand" */ t|~t] t
type /* ERROR "expected ']'" */ Sync int // placeholder to synchronize the parser
type _[_ t, t /* ERROR "type parameters must be named" */ ] t
type _[_ ~t, t /* ERROR "type parameters must be named" */ ] t
type _[_ t, ~ /* ERROR "type parameters must be named" */ t] t
type _[_ ~t, ~ /* ERROR "type parameters must be named" */ t] t
type _[_ t|t, t /* ERROR "type parameters must be named" */ |t] t
type _[_ ~t|t, t /* ERROR "type parameters must be named" */ |t] t
type _[_ t|t, ~ /* ERROR "type parameters must be named" */ t|t] t
type _[_ ~t|t, ~ /* ERROR "type parameters must be named" */ t|t] t