1
2
3
4
5
6
7 package expr0
8
9 type mybool bool
10
11 var (
12
13 b0 = true
14 b1 bool = b0
15 b2 = !true
16 b3 = !b1
17 b4 bool = !true
18 b5 bool = !b4
19 b6 = +b0
20 b7 = -b0
21 b8 = ^b0
22 b9 = *b0
23 b10 = &true
24 b11 = &b0
25 b12 = <-b0
26 b13 = & & b0
27 b14 = ~ b0
28
29
30 _ = byte(0)
31 _ = byte(- 1)
32 _ = - byte(1)
33 _ = byte (0) - byte(1)
34 _ = ~ byte(0)
35
36
37 i0 = 1
38 i1 int = i0
39 i2 = +1
40 i3 = +i0
41 i4 int = +1
42 i5 int = +i4
43 i6 = -1
44 i7 = -i0
45 i8 int = -1
46 i9 int = -i4
47 i10 = !i0
48 i11 = ^1
49 i12 = ^i0
50 i13 int = ^1
51 i14 int = ^i4
52 i15 = *i0
53 i16 = &i0
54 i17 = *i16
55 i18 = <-i16
56 i19 = ~ i0
57
58
59 u0 = uint(1)
60 u1 uint = u0
61 u2 = +1
62 u3 = +u0
63 u4 uint = +1
64 u5 uint = +u4
65 u6 = -1
66 u7 = -u0
67 u8 uint = - 1
68 u9 uint = -u4
69 u10 = !u0
70 u11 = ^1
71 u12 = ^i0
72 u13 uint = ^ 1
73 u14 uint = ^u4
74 u15 = *u0
75 u16 = &u0
76 u17 = *u16
77 u18 = <-u16
78 u19 = ^uint(0)
79 u20 = ~ u0
80
81
82 f0 = float64(1)
83 f1 float64 = f0
84 f2 = +1
85 f3 = +f0
86 f4 float64 = +1
87 f5 float64 = +f4
88 f6 = -1
89 f7 = -f0
90 f8 float64 = -1
91 f9 float64 = -f4
92 f10 = !f0
93 f11 = ^1
94 f12 = ^i0
95 f13 float64 = ^1
96 f14 float64 = ^f4
97 f15 = *f0
98 f16 = &f0
99 f17 = *u16
100 f18 = <-u16
101 f19 = ~ f0
102
103
104 c0 = complex128(1)
105 c1 complex128 = c0
106 c2 = +1
107 c3 = +c0
108 c4 complex128 = +1
109 c5 complex128 = +c4
110 c6 = -1
111 c7 = -c0
112 c8 complex128 = -1
113 c9 complex128 = -c4
114 c10 = !c0
115 c11 = ^1
116 c12 = ^i0
117 c13 complex128 = ^1
118 c14 complex128 = ^c4
119 c15 = *c0
120 c16 = &c0
121 c17 = *u16
122 c18 = <-u16
123 c19 = ~ c0
124
125
126 s0 = "foo"
127 s1 = +"foo"
128 s2 = -s0
129 s3 = !s0
130 s4 = ^s0
131 s5 = *s4
132 s6 = &s4
133 s7 = *s6
134 s8 = <-s7
135 s9 = ~ s0
136
137
138 ch chan int
139 rc <-chan float64
140 sc chan <- string
141 ch0 = +ch
142 ch1 = -ch
143 ch2 = !ch
144 ch3 = ^ch
145 ch4 = *ch
146 ch5 = &ch
147 ch6 = *ch5
148 ch7 = <-ch
149 ch8 = <-rc
150 ch9 = <-sc
151 ch10, ok = <-ch
152
153 ch11, myok = <-ch
154 _ mybool = myok
155 ch12 = ~ ch
156
157 )
158
159
160 type T struct{x, y int}
161
162 func f() T { return T{} }
163
164 var (
165 _ = &T{1, 2}
166 _ = &[...]int{}
167 _ = &[]int{}
168 _ = &[]int{}
169 _ = &map[string]T{}
170 _ = &(T{1, 2})
171 _ = &((((T{1, 2}))))
172 _ = &f ()
173 )
174
175
176 type P *P
177
178 var (
179 p1 P = new(P)
180 p2 P = *p1
181 p3 P = &p2
182 )
183
184 func g() (a, b int) { return }
185
186 func _() {
187 _ = -g ()
188 _ = <-g ()
189 }
190
191
192 var (
193 _ = ~ 0
194 _ = ~ "foo"
195 _ = ~ i0
196 )
197
View as plain text