v2 / vlib / v / checker / tests / always_true_false_branch.out
483 lines · 483 sloc · 17.37 KB · e8fae788cedcd2bf098f4bc78f294bcf544f7864
Raw
1vlib/v/checker/tests/always_true_false_branch.vv:5:23: notice: condition is always true
2 3 | fn main() {
3 4 | x := 1
4 5 | if_always_true := if x == x {
5 | ~~~~~~
6 6 | 1
7 7 | } else if true {
8vlib/v/checker/tests/always_true_false_branch.vv:7:12: notice: condition is always true
9 5 | if_always_true := if x == x {
10 6 | 1
11 7 | } else if true {
12 | ~~~~
13 8 | 1
14 9 | } else if !false {
15vlib/v/checker/tests/always_true_false_branch.vv:11:12: notice: condition is always true
16 9 | } else if !false {
17 10 | 1
18 11 | } else if true == true {
19 | ~~~~~~~~~~~~
20 12 | 1
21 13 | } else if true != false {
22vlib/v/checker/tests/always_true_false_branch.vv:13:12: notice: condition is always true
23 11 | } else if true == true {
24 12 | 1
25 13 | } else if true != false {
26 | ~~~~~~~~~~~~~
27 14 | 1
28 15 | } else if false == false {
29vlib/v/checker/tests/always_true_false_branch.vv:15:12: notice: condition is always true
30 13 | } else if true != false {
31 14 | 1
32 15 | } else if false == false {
33 | ~~~~~~~~~~~~~~
34 16 | 1
35 17 | } else if false != true {
36vlib/v/checker/tests/always_true_false_branch.vv:17:12: notice: condition is always true
37 15 | } else if false == false {
38 16 | 1
39 17 | } else if false != true {
40 | ~~~~~~~~~~~~~
41 18 | 1
42 19 | } else if 'a' == 'a' {
43vlib/v/checker/tests/always_true_false_branch.vv:19:12: notice: condition is always true
44 17 | } else if false != true {
45 18 | 1
46 19 | } else if 'a' == 'a' {
47 | ~~~~~~~~~~
48 20 | 1
49 21 | } else if 'a' != 'b' {
50vlib/v/checker/tests/always_true_false_branch.vv:21:12: notice: condition is always true
51 19 | } else if 'a' == 'a' {
52 20 | 1
53 21 | } else if 'a' != 'b' {
54 | ~~~~~~~~~~
55 22 | 1
56 23 | } else if 1 == 1 {
57vlib/v/checker/tests/always_true_false_branch.vv:23:12: notice: condition is always true
58 21 | } else if 'a' != 'b' {
59 22 | 1
60 23 | } else if 1 == 1 {
61 | ~~~~~~
62 24 | 1
63 25 | } else if 1 != 2 {
64vlib/v/checker/tests/always_true_false_branch.vv:25:12: notice: condition is always true
65 23 | } else if 1 == 1 {
66 24 | 1
67 25 | } else if 1 != 2 {
68 | ~~~~~~
69 26 | 1
70 27 | } else if 1 >= 1 {
71vlib/v/checker/tests/always_true_false_branch.vv:27:12: notice: condition is always true
72 25 | } else if 1 != 2 {
73 26 | 1
74 27 | } else if 1 >= 1 {
75 | ~~~~~~
76 28 | 1
77 29 | } else if 1 <= 1 {
78vlib/v/checker/tests/always_true_false_branch.vv:29:12: notice: condition is always true
79 27 | } else if 1 >= 1 {
80 28 | 1
81 29 | } else if 1 <= 1 {
82 | ~~~~~~
83 30 | 1
84 31 | } else if 1 < 2 {
85vlib/v/checker/tests/always_true_false_branch.vv:31:12: notice: condition is always true
86 29 | } else if 1 <= 1 {
87 30 | 1
88 31 | } else if 1 < 2 {
89 | ~~~~~
90 32 | 1
91 33 | } else if 2 > 1 {
92vlib/v/checker/tests/always_true_false_branch.vv:33:12: notice: condition is always true
93 31 | } else if 1 < 2 {
94 32 | 1
95 33 | } else if 2 > 1 {
96 | ~~~~~
97 34 | 1
98 35 | } else if 1.5 == 1.5 {
99vlib/v/checker/tests/always_true_false_branch.vv:35:12: notice: condition is always true
100 33 | } else if 2 > 1 {
101 34 | 1
102 35 | } else if 1.5 == 1.5 {
103 | ~~~~~~~~~~
104 36 | 1
105 37 | } else if 1.5 != 2.5 {
106vlib/v/checker/tests/always_true_false_branch.vv:37:12: notice: condition is always true
107 35 | } else if 1.5 == 1.5 {
108 36 | 1
109 37 | } else if 1.5 != 2.5 {
110 | ~~~~~~~~~~
111 38 | 1
112 39 | } else if 1.5 >= 1.5 {
113vlib/v/checker/tests/always_true_false_branch.vv:39:12: notice: condition is always true
114 37 | } else if 1.5 != 2.5 {
115 38 | 1
116 39 | } else if 1.5 >= 1.5 {
117 | ~~~~~~~~~~
118 40 | 1
119 41 | } else if 1.5 <= 1.5 {
120vlib/v/checker/tests/always_true_false_branch.vv:41:12: notice: condition is always true
121 39 | } else if 1.5 >= 1.5 {
122 40 | 1
123 41 | } else if 1.5 <= 1.5 {
124 | ~~~~~~~~~~
125 42 | 1
126 43 | } else if 1.5 < 2.5 {
127vlib/v/checker/tests/always_true_false_branch.vv:43:12: notice: condition is always true
128 41 | } else if 1.5 <= 1.5 {
129 42 | 1
130 43 | } else if 1.5 < 2.5 {
131 | ~~~~~~~~~
132 44 | 1
133 45 | } else if 2.5 > 1.5 {
134vlib/v/checker/tests/always_true_false_branch.vv:45:12: notice: condition is always true
135 43 | } else if 1.5 < 2.5 {
136 44 | 1
137 45 | } else if 2.5 > 1.5 {
138 | ~~~~~~~~~
139 46 | 1
140 47 | } else if `1` == `1` {
141vlib/v/checker/tests/always_true_false_branch.vv:47:12: notice: condition is always true
142 45 | } else if 2.5 > 1.5 {
143 46 | 1
144 47 | } else if `1` == `1` {
145 | ~~~~~~~~~~
146 48 | 1
147 49 | } else if `1` != `2` {
148vlib/v/checker/tests/always_true_false_branch.vv:49:12: notice: condition is always true
149 47 | } else if `1` == `1` {
150 48 | 1
151 49 | } else if `1` != `2` {
152 | ~~~~~~~~~~
153 50 | 1
154 51 | } else if `1` >= `1` {
155vlib/v/checker/tests/always_true_false_branch.vv:51:12: notice: condition is always true
156 49 | } else if `1` != `2` {
157 50 | 1
158 51 | } else if `1` >= `1` {
159 | ~~~~~~~~~~
160 52 | 1
161 53 | } else if `1` <= `1` {
162vlib/v/checker/tests/always_true_false_branch.vv:53:12: notice: condition is always true
163 51 | } else if `1` >= `1` {
164 52 | 1
165 53 | } else if `1` <= `1` {
166 | ~~~~~~~~~~
167 54 | 1
168 55 | } else if `1` < `2` {
169vlib/v/checker/tests/always_true_false_branch.vv:55:12: notice: condition is always true
170 53 | } else if `1` <= `1` {
171 54 | 1
172 55 | } else if `1` < `2` {
173 | ~~~~~~~~~
174 56 | 1
175 57 | } else if `2` > `1` {
176vlib/v/checker/tests/always_true_false_branch.vv:57:12: notice: condition is always true
177 55 | } else if `1` < `2` {
178 56 | 1
179 57 | } else if `2` > `1` {
180 | ~~~~~~~~~
181 58 | 1
182 59 | } else if 1 == 1 && 2 <= 2 && 3 >= 3 && 4 != 5 {
183vlib/v/checker/tests/always_true_false_branch.vv:59:1: notice: condition is always true
184 57 | } else if `2` > `1` {
185 58 | 1
186 59 | } else if 1 == 1 && 2 <= 2 && 3 >= 3 && 4 != 5 {
187 | ^
188 60 | 1
189 61 | } else if 1 == 1 || 4 > 5 || 6 < 3 || 5 != 5 {
190vlib/v/checker/tests/always_true_false_branch.vv:61:1: notice: condition is always true
191 59 | } else if 1 == 1 && 2 <= 2 && 3 >= 3 && 4 != 5 {
192 60 | 1
193 61 | } else if 1 == 1 || 4 > 5 || 6 < 3 || 5 != 5 {
194 | ^
195 62 | 1
196 63 | } else {
197vlib/v/checker/tests/always_true_false_branch.vv:69:24: notice: condition is always false
198 67 | dump(if_always_true)
199 68 |
200 69 | if_always_false := if x != x {
201 | ~~~~~~
202 70 | 1
203 71 | } else if false {
204vlib/v/checker/tests/always_true_false_branch.vv:71:12: notice: condition is always false
205 69 | if_always_false := if x != x {
206 70 | 1
207 71 | } else if false {
208 | ~~~~~
209 72 | 1
210 73 | } else if !true {
211vlib/v/checker/tests/always_true_false_branch.vv:75:12: notice: condition is always false
212 73 | } else if !true {
213 74 | 1
214 75 | } else if true != true {
215 | ~~~~~~~~~~~~
216 76 | 1
217 77 | } else if true == false {
218vlib/v/checker/tests/always_true_false_branch.vv:77:12: notice: condition is always false
219 75 | } else if true != true {
220 76 | 1
221 77 | } else if true == false {
222 | ~~~~~~~~~~~~~
223 78 | 1
224 79 | } else if false != false {
225vlib/v/checker/tests/always_true_false_branch.vv:79:12: notice: condition is always false
226 77 | } else if true == false {
227 78 | 1
228 79 | } else if false != false {
229 | ~~~~~~~~~~~~~~
230 80 | 1
231 81 | } else if false == true {
232vlib/v/checker/tests/always_true_false_branch.vv:81:12: notice: condition is always false
233 79 | } else if false != false {
234 80 | 1
235 81 | } else if false == true {
236 | ~~~~~~~~~~~~~
237 82 | 1
238 83 | } else if 'a' != 'a' {
239vlib/v/checker/tests/always_true_false_branch.vv:83:12: notice: condition is always false
240 81 | } else if false == true {
241 82 | 1
242 83 | } else if 'a' != 'a' {
243 | ~~~~~~~~~~
244 84 | 1
245 85 | } else if 'a' == 'b' {
246vlib/v/checker/tests/always_true_false_branch.vv:85:12: notice: condition is always false
247 83 | } else if 'a' != 'a' {
248 84 | 1
249 85 | } else if 'a' == 'b' {
250 | ~~~~~~~~~~
251 86 | 1
252 87 | } else if 1 != 1 {
253vlib/v/checker/tests/always_true_false_branch.vv:87:12: notice: condition is always false
254 85 | } else if 'a' == 'b' {
255 86 | 1
256 87 | } else if 1 != 1 {
257 | ~~~~~~
258 88 | 1
259 89 | } else if 1 == 2 {
260vlib/v/checker/tests/always_true_false_branch.vv:89:12: notice: condition is always false
261 87 | } else if 1 != 1 {
262 88 | 1
263 89 | } else if 1 == 2 {
264 | ~~~~~~
265 90 | 1
266 91 | } else if 1 > 1 {
267vlib/v/checker/tests/always_true_false_branch.vv:91:12: notice: condition is always false
268 89 | } else if 1 == 2 {
269 90 | 1
270 91 | } else if 1 > 1 {
271 | ~~~~~
272 92 | 1
273 93 | } else if 1 < 1 {
274vlib/v/checker/tests/always_true_false_branch.vv:93:12: notice: condition is always false
275 91 | } else if 1 > 1 {
276 92 | 1
277 93 | } else if 1 < 1 {
278 | ~~~~~
279 94 | 1
280 95 | } else if 1 >= 2 {
281vlib/v/checker/tests/always_true_false_branch.vv:95:12: notice: condition is always false
282 93 | } else if 1 < 1 {
283 94 | 1
284 95 | } else if 1 >= 2 {
285 | ~~~~~~
286 96 | 1
287 97 | } else if 2 <= 1 {
288vlib/v/checker/tests/always_true_false_branch.vv:97:12: notice: condition is always false
289 95 | } else if 1 >= 2 {
290 96 | 1
291 97 | } else if 2 <= 1 {
292 | ~~~~~~
293 98 | 1
294 99 | } else if 1.5 != 1.5 {
295vlib/v/checker/tests/always_true_false_branch.vv:99:12: notice: condition is always false
296 97 | } else if 2 <= 1 {
297 98 | 1
298 99 | } else if 1.5 != 1.5 {
299 | ~~~~~~~~~~
300 100 | 1
301 101 | } else if 1.5 == 2.5 {
302vlib/v/checker/tests/always_true_false_branch.vv:101:12: notice: condition is always false
303 99 | } else if 1.5 != 1.5 {
304 100 | 1
305 101 | } else if 1.5 == 2.5 {
306 | ~~~~~~~~~~
307 102 | 1
308 103 | } else if 1.5 > 1.5 {
309vlib/v/checker/tests/always_true_false_branch.vv:103:12: notice: condition is always false
310 101 | } else if 1.5 == 2.5 {
311 102 | 1
312 103 | } else if 1.5 > 1.5 {
313 | ~~~~~~~~~
314 104 | 1
315 105 | } else if 1.5 < 1.5 {
316vlib/v/checker/tests/always_true_false_branch.vv:105:12: notice: condition is always false
317 103 | } else if 1.5 > 1.5 {
318 104 | 1
319 105 | } else if 1.5 < 1.5 {
320 | ~~~~~~~~~
321 106 | 1
322 107 | } else if 1.5 >= 2.5 {
323vlib/v/checker/tests/always_true_false_branch.vv:107:12: notice: condition is always false
324 105 | } else if 1.5 < 1.5 {
325 106 | 1
326 107 | } else if 1.5 >= 2.5 {
327 | ~~~~~~~~~~
328 108 | 1
329 109 | } else if 2.5 <= 1.5 {
330vlib/v/checker/tests/always_true_false_branch.vv:109:12: notice: condition is always false
331 107 | } else if 1.5 >= 2.5 {
332 108 | 1
333 109 | } else if 2.5 <= 1.5 {
334 | ~~~~~~~~~~
335 110 | 1
336 111 | } else if `1` != `1` {
337vlib/v/checker/tests/always_true_false_branch.vv:111:12: notice: condition is always false
338 109 | } else if 2.5 <= 1.5 {
339 110 | 1
340 111 | } else if `1` != `1` {
341 | ~~~~~~~~~~
342 112 | 1
343 113 | } else if `1` == `2` {
344vlib/v/checker/tests/always_true_false_branch.vv:113:12: notice: condition is always false
345 111 | } else if `1` != `1` {
346 112 | 1
347 113 | } else if `1` == `2` {
348 | ~~~~~~~~~~
349 114 | 1
350 115 | } else if `1` < `1` {
351vlib/v/checker/tests/always_true_false_branch.vv:115:12: notice: condition is always false
352 113 | } else if `1` == `2` {
353 114 | 1
354 115 | } else if `1` < `1` {
355 | ~~~~~~~~~
356 116 | 1
357 117 | } else if `1` > `1` {
358vlib/v/checker/tests/always_true_false_branch.vv:117:12: notice: condition is always false
359 115 | } else if `1` < `1` {
360 116 | 1
361 117 | } else if `1` > `1` {
362 | ~~~~~~~~~
363 118 | 1
364 119 | } else if `1` >= `2` {
365vlib/v/checker/tests/always_true_false_branch.vv:119:12: notice: condition is always false
366 117 | } else if `1` > `1` {
367 118 | 1
368 119 | } else if `1` >= `2` {
369 | ~~~~~~~~~~
370 120 | 1
371 121 | } else if `2` <= `1` {
372vlib/v/checker/tests/always_true_false_branch.vv:121:12: notice: condition is always false
373 119 | } else if `1` >= `2` {
374 120 | 1
375 121 | } else if `2` <= `1` {
376 | ~~~~~~~~~~
377 122 | 1
378 123 | } else if 1 == 2 && 3 >= 3 && 4 <= 5 && 5 != 5 {
379vlib/v/checker/tests/always_true_false_branch.vv:123:1: notice: condition is always false
380 121 | } else if `2` <= `1` {
381 122 | 1
382 123 | } else if 1 == 2 && 3 >= 3 && 4 <= 5 && 5 != 5 {
383 | ^
384 124 | 1
385 125 | } else if 1 == 2 || 2 > 3 || 5 < 4 {
386vlib/v/checker/tests/always_true_false_branch.vv:125:1: notice: condition is always false
387 123 | } else if 1 == 2 && 3 >= 3 && 4 <= 5 && 5 != 5 {
388 124 | 1
389 125 | } else if 1 == 2 || 2 > 3 || 5 < 4 {
390 | ^
391 126 | 0
392 127 | } else {
393vlib/v/checker/tests/always_true_false_branch.vv:134:3: notice: match is always true
394 132 |
395 133 | match_always_true_var := match x {
396 134 | x {
397 | ^
398 135 | 'haha'
399 136 | }
400vlib/v/checker/tests/always_true_false_branch.vv:144:3: notice: match is always true
401 142 |
402 143 | match_always_true_false_bool := match true {
403 144 | true {
404 | ~~~~
405 145 | 'haha'
406 146 | }
407vlib/v/checker/tests/always_true_false_branch.vv:147:3: notice: match is always false
408 145 | 'haha'
409 146 | }
410 147 | false {
411 | ~~~~~
412 148 | 'cc'
413 149 | }
414vlib/v/checker/tests/always_true_false_branch.vv:154:3: notice: match is always true
415 152 |
416 153 | match_always_true_false_int := match 1 {
417 154 | 1 {
418 | ^
419 155 | 'haha'
420 156 | }
421vlib/v/checker/tests/always_true_false_branch.vv:157:3: notice: match is always false
422 155 | 'haha'
423 156 | }
424 157 | 2 {
425 | ^
426 158 | 'cc'
427 159 | }
428vlib/v/checker/tests/always_true_false_branch.vv:167:3: notice: match is always true
429 165 |
430 166 | match_always_true_false_f64 := match 1.5 {
431 167 | 1.5 {
432 | ~~~
433 168 | 'haha'
434 169 | }
435vlib/v/checker/tests/always_true_false_branch.vv:170:3: notice: match is always false
436 168 | 'haha'
437 169 | }
438 170 | 2.5 {
439 | ~~~
440 171 | 'cc'
441 172 | }
442vlib/v/checker/tests/always_true_false_branch.vv:180:3: notice: match is always true
443 178 |
444 179 | match_always_true_false_string := match 'a' {
445 180 | 'a' {
446 | ~~~
447 181 | 'haha'
448 182 | }
449vlib/v/checker/tests/always_true_false_branch.vv:183:3: notice: match is always false
450 181 | 'haha'
451 182 | }
452 183 | 'b' {
453 | ~~~
454 184 | 'cc'
455 185 | }
456vlib/v/checker/tests/always_true_false_branch.vv:193:3: notice: match is always true
457 191 |
458 192 | match_always_true_false_rune := match `a` {
459 193 | `a` {
460 | ~~~
461 194 | 'haha'
462 195 | }
463vlib/v/checker/tests/always_true_false_branch.vv:196:3: notice: match is always false
464 194 | 'haha'
465 195 | }
466 196 | `b` {
467 | ~~~
468 197 | 'cc'
469 198 | }
470vlib/v/checker/tests/always_true_false_branch.vv:5:23: warning: self-comparison in `if` condition is always true; following branches may be unreachable
471 3 | fn main() {
472 4 | x := 1
473 5 | if_always_true := if x == x {
474 | ~~~~~~
475 6 | 1
476 7 | } else if true {
477vlib/v/checker/tests/always_true_false_branch.vv:134:3: warning: self-comparison match branch is always true; following branches may be unreachable
478 132 |
479 133 | match_always_true_var := match x {
480 134 | x {
481 | ^
482 135 | 'haha'
483 136 | }
484