1
2
3
4
5 package typecheck
6
7 import "cmd/compile/internal/types"
8
9
10
11
12
13 const (
14
15 packageTag = -(iota + 1)
16 constTag
17 typeTag
18 varTag
19 funcTag
20 endTag
21
22
23 namedTag
24 arrayTag
25 sliceTag
26 dddTag
27 structTag
28 pointerTag
29 signatureTag
30 interfaceTag
31 mapTag
32 chanTag
33
34
35 falseTag
36 trueTag
37 int64Tag
38 floatTag
39 fractionTag
40 complexTag
41 stringTag
42 nilTag
43 unknownTag
44
45
46 aliasTag
47 )
48
49 var predecl []*types.Type
50
51 func predeclared() []*types.Type {
52 if predecl == nil {
53
54
55 predecl = []*types.Type{
56
57 types.Types[types.TBOOL],
58 types.Types[types.TINT],
59 types.Types[types.TINT8],
60 types.Types[types.TINT16],
61 types.Types[types.TINT32],
62 types.Types[types.TINT64],
63 types.Types[types.TUINT],
64 types.Types[types.TUINT8],
65 types.Types[types.TUINT16],
66 types.Types[types.TUINT32],
67 types.Types[types.TUINT64],
68 types.Types[types.TUINTPTR],
69 types.Types[types.TFLOAT32],
70 types.Types[types.TFLOAT64],
71 types.Types[types.TCOMPLEX64],
72 types.Types[types.TCOMPLEX128],
73 types.Types[types.TSTRING],
74
75
76 types.ByteType,
77 types.RuneType,
78
79
80 types.ErrorType,
81
82
83 types.UntypedBool,
84 types.UntypedInt,
85 types.UntypedRune,
86 types.UntypedFloat,
87 types.UntypedComplex,
88 types.UntypedString,
89 types.Types[types.TNIL],
90
91
92 types.Types[types.TUNSAFEPTR],
93
94
95 types.Types[types.Txxx],
96
97
98 types.Types[types.TANY],
99
100
101 types.ComparableType,
102
103
104 types.AnyType,
105 }
106 }
107 return predecl
108 }
109
View as plain text