v2 / vlib / v / checker / tests / infix_err.out
168 lines · 168 sloc · 5.44 KB · e2e5cf8db56f3562c7baa735061690be936bdf3e
Raw
1vlib/v/checker/tests/infix_err.vv:13:5: error: mismatched types `string` and `?string`
2 11 | }
3 12 |
4 13 | _ = '' + f()
5 | ~~~~~~~~
6 14 | _ = f() + ''
7 15 | _ = f() + f()
8vlib/v/checker/tests/infix_err.vv:13:10: error: `?string` cannot be used as `string`, unwrap the option first
9 11 | }
10 12 |
11 13 | _ = '' + f()
12 | ~~~
13 14 | _ = f() + ''
14 15 | _ = f() + f()
15vlib/v/checker/tests/infix_err.vv:14:5: error: mismatched types `?string` and `string`
16 12 |
17 13 | _ = '' + f()
18 14 | _ = f() + ''
19 | ~~~~~~~~
20 15 | _ = f() + f()
21 16 |
22vlib/v/checker/tests/infix_err.vv:14:5: error: `?string` cannot be used as `string`, unwrap the option first
23 12 |
24 13 | _ = '' + f()
25 14 | _ = f() + ''
26 | ~~~
27 15 | _ = f() + f()
28 16 |
29vlib/v/checker/tests/infix_err.vv:15:9: error: `+` cannot be used with `?string`
30 13 | _ = '' + f()
31 14 | _ = f() + ''
32 15 | _ = f() + f()
33 | ^
34 16 |
35 17 | _ = 4 + g()
36vlib/v/checker/tests/infix_err.vv:15:5: error: `?string` cannot be used as `string`, unwrap the option first
37 13 | _ = '' + f()
38 14 | _ = f() + ''
39 15 | _ = f() + f()
40 | ~~~
41 16 |
42 17 | _ = 4 + g()
43vlib/v/checker/tests/infix_err.vv:17:7: error: `+` cannot be used with `?int`
44 15 | _ = f() + f()
45 16 |
46 17 | _ = 4 + g()
47 | ^
48 18 | _ = int(0) + g()
49 19 | _ = g() + int(3)
50vlib/v/checker/tests/infix_err.vv:17:9: error: `?int` cannot be used as `int literal`, unwrap the option first
51 15 | _ = f() + f()
52 16 |
53 17 | _ = 4 + g()
54 | ~~~
55 18 | _ = int(0) + g()
56 19 | _ = g() + int(3)
57vlib/v/checker/tests/infix_err.vv:18:14: error: `?int` cannot be used as `int`, unwrap the option first
58 16 |
59 17 | _ = 4 + g()
60 18 | _ = int(0) + g()
61 | ~~~
62 19 | _ = g() + int(3)
63 20 | _ = g() + 3
64vlib/v/checker/tests/infix_err.vv:19:9: error: `+` cannot be used with `?int`
65 17 | _ = 4 + g()
66 18 | _ = int(0) + g()
67 19 | _ = g() + int(3)
68 | ^
69 20 | _ = g() + 3
70 21 |
71vlib/v/checker/tests/infix_err.vv:19:5: error: `?int` cannot be used as `int`, unwrap the option first
72 17 | _ = 4 + g()
73 18 | _ = int(0) + g()
74 19 | _ = g() + int(3)
75 | ~~~
76 20 | _ = g() + 3
77 21 |
78vlib/v/checker/tests/infix_err.vv:20:9: error: `+` cannot be used with `?int`
79 18 | _ = int(0) + g()
80 19 | _ = g() + int(3)
81 20 | _ = g() + 3
82 | ^
83 21 |
84 22 | // binary operands
85vlib/v/checker/tests/infix_err.vv:20:5: error: `?int` cannot be used as `int literal`, unwrap the option first
86 18 | _ = int(0) + g()
87 19 | _ = g() + int(3)
88 20 | _ = g() + 3
89 | ~~~
90 21 |
91 22 | // binary operands
92vlib/v/checker/tests/infix_err.vv:23:5: error: left operand for `&&` is not a boolean
93 21 |
94 22 | // binary operands
95 23 | _ = 1 && 2
96 | ^
97 24 | _ = true || 2
98 25 |
99vlib/v/checker/tests/infix_err.vv:23:10: error: right operand for `&&` is not a boolean
100 21 |
101 22 | // binary operands
102 23 | _ = 1 && 2
103 | ^
104 24 | _ = true || 2
105 25 |
106vlib/v/checker/tests/infix_err.vv:24:13: error: right operand for `||` is not a boolean
107 22 | // binary operands
108 23 | _ = 1 && 2
109 24 | _ = true || 2
110 | ^
111 25 |
112 26 | // boolean expressions
113vlib/v/checker/tests/infix_err.vv:24:5: error: infix expr: cannot use `int literal` (right expression) as `bool`
114 22 | // binary operands
115 23 | _ = 1 && 2
116 24 | _ = true || 2
117 | ~~~~~~~~~
118 25 |
119 26 | // boolean expressions
120vlib/v/checker/tests/infix_err.vv:27:22: error: ambiguous boolean expression. use `()` to ensure correct order of operations
121 25 |
122 26 | // boolean expressions
123 27 | _ = 1 == 1 && 2 == 2 || 3 == 3
124 | ~~
125 28 | _ = 1 == 1 && 2 == 2 || 3 == 3 && 4 == 4
126 29 | _ = 1 + println('')
127vlib/v/checker/tests/infix_err.vv:28:22: error: ambiguous boolean expression. use `()` to ensure correct order of operations
128 26 | // boolean expressions
129 27 | _ = 1 == 1 && 2 == 2 || 3 == 3
130 28 | _ = 1 == 1 && 2 == 2 || 3 == 3 && 4 == 4
131 | ~~
132 29 | _ = 1 + println('')
133 30 |
134vlib/v/checker/tests/infix_err.vv:29:5: error: mismatched types `int literal` and `void`
135 27 | _ = 1 == 1 && 2 == 2 || 3 == 3
136 28 | _ = 1 == 1 && 2 == 2 || 3 == 3 && 4 == 4
137 29 | _ = 1 + println('')
138 | ~~~~~~~~~~~~~~~
139 30 |
140 31 | // struct members
141vlib/v/checker/tests/infix_err.vv:36:11: error: `?string` cannot be used as `string`, unwrap the option first
142 34 | }
143 35 | name := 'a name'
144 36 | _ := data.name == 'a name'
145 | ~~~~
146 37 | _ := 'a name' == data.name
147 38 | _ := data.name == name
148vlib/v/checker/tests/infix_err.vv:37:23: error: `?string` cannot be used as `string`, unwrap the option first
149 35 | name := 'a name'
150 36 | _ := data.name == 'a name'
151 37 | _ := 'a name' == data.name
152 | ~~~~
153 38 | _ := data.name == name
154 39 | _ := name == data.name
155vlib/v/checker/tests/infix_err.vv:38:11: error: `?string` cannot be used as `string`, unwrap the option first
156 36 | _ := data.name == 'a name'
157 37 | _ := 'a name' == data.name
158 38 | _ := data.name == name
159 | ~~~~
160 39 | _ := name == data.name
161 40 |
162vlib/v/checker/tests/infix_err.vv:39:19: error: `?string` cannot be used as `string`, unwrap the option first
163 37 | _ := 'a name' == data.name
164 38 | _ := data.name == name
165 39 | _ := name == data.name
166 | ~~~~
167 40 |
168 41 | // these should not error
169