blob: 363716913b376c1b9f2ff3916b0dde188d3731ff (
plain)
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
76
77
78
79
80
81
|
vlib/v/checker/tests/infix_err.vv:7:5: error: mismatched types `string` and `?string`
5 | return none
6 | }
7 | _ = '' + f()
| ~~~~~~~~
8 | _ = f() + ''
9 | _ = f() + f()
vlib/v/checker/tests/infix_err.vv:8:5: error: mismatched types `?string` and `string`
6 | }
7 | _ = '' + f()
8 | _ = f() + ''
| ~~~~~~~~
9 | _ = f() + f()
10 |
vlib/v/checker/tests/infix_err.vv:9:9: error: `+` cannot be used with `?string`
7 | _ = '' + f()
8 | _ = f() + ''
9 | _ = f() + f()
| ^
10 |
11 | _ = 4 + g()
vlib/v/checker/tests/infix_err.vv:11:7: error: `+` cannot be used with `?int`
9 | _ = f() + f()
10 |
11 | _ = 4 + g()
| ^
12 | _ = int(0) + g() // FIXME not detected
13 | _ = g() + int(3)
vlib/v/checker/tests/infix_err.vv:12:5: error: unwrapped optional cannot be used in an infix expression
10 |
11 | _ = 4 + g()
12 | _ = int(0) + g() // FIXME not detected
| ~~~~~~~~~~~~
13 | _ = g() + int(3)
14 | _ = g() + 3
vlib/v/checker/tests/infix_err.vv:13:9: error: `+` cannot be used with `?int`
11 | _ = 4 + g()
12 | _ = int(0) + g() // FIXME not detected
13 | _ = g() + int(3)
| ^
14 | _ = g() + 3
15 |
vlib/v/checker/tests/infix_err.vv:14:9: error: `+` cannot be used with `?int`
12 | _ = int(0) + g() // FIXME not detected
13 | _ = g() + int(3)
14 | _ = g() + 3
| ^
15 |
16 | // binary operands
vlib/v/checker/tests/infix_err.vv:17:5: error: left operand for `&&` is not a boolean
15 |
16 | // binary operands
17 | _ = 1 && 2
| ^
18 | _ = true || 2
19 |
vlib/v/checker/tests/infix_err.vv:18:13: error: right operand for `||` is not a boolean
16 | // binary operands
17 | _ = 1 && 2
18 | _ = true || 2
| ^
19 |
20 | // boolean expressions
vlib/v/checker/tests/infix_err.vv:21:22: error: ambiguous boolean expression. use `()` to ensure correct order of operations
19 |
20 | // boolean expressions
21 | _ = 1 == 1 && 2 == 2 || 3 == 3
| ~~
22 | _ = 1 == 1
23 | && 2 == 2 || 3 == 3
vlib/v/checker/tests/infix_err.vv:23:12: error: ambiguous boolean expression. use `()` to ensure correct order of operations
21 | _ = 1 == 1 && 2 == 2 || 3 == 3
22 | _ = 1 == 1
23 | && 2 == 2 || 3 == 3
| ~~
24 | && 4 == 4
vlib/v/checker/tests/infix_err.vv:24:2: error: ambiguous boolean expression. use `()` to ensure correct order of operations
22 | _ = 1 == 1
23 | && 2 == 2 || 3 == 3
24 | && 4 == 4
| ~~
|