v/vlib/v/checker/tests/in_mismatch_type.out

78 lines
2.9 KiB
Plaintext
Raw Normal View History

vlib/v/checker/tests/in_mismatch_type.vv:10:5: error: left operand to `in` does not match the array element type: expected `string`, not `int literal`
2020-05-17 02:13:08 +02:00
8 | }
9 | s := 'abcd'
10 | if 1 in a_s {
| ~~~~~~~~
2020-05-17 02:13:08 +02:00
11 | println('ok')
12 | }
vlib/v/checker/tests/in_mismatch_type.vv:13:5: error: left operand to `in` does not match the map key type: expected `string`, not `int literal`
2020-05-17 02:13:08 +02:00
11 | println('ok')
12 | }
13 | if 2 in m {
| ~~~~~~
2020-05-17 02:13:08 +02:00
14 | println('yeah')
15 | }
vlib/v/checker/tests/in_mismatch_type.vv:16:7: error: `in` can only be used with arrays and maps
2020-05-17 02:13:08 +02:00
14 | println('yeah')
15 | }
2020-05-17 02:13:08 +02:00
16 | if 3 in s {
| ~~
2020-05-17 02:13:08 +02:00
17 | println('dope')
18 | }
vlib/v/checker/tests/in_mismatch_type.vv:19:9: error: `in` can only be used with arrays and maps
2020-05-17 02:13:08 +02:00
17 | println('dope')
18 | }
2020-05-17 02:13:08 +02:00
19 | if `a` in s {
| ~~
2020-05-17 02:13:08 +02:00
20 | println("oh no :'(")
21 | }
vlib/v/checker/tests/in_mismatch_type.vv:22:7: error: `in` can only be used with arrays and maps
2020-05-17 02:13:08 +02:00
20 | println("oh no :'(")
21 | }
2020-05-17 02:13:08 +02:00
22 | if 1 in 12 {
| ~~
23 | println('right')
24 | }
vlib/v/checker/tests/in_mismatch_type.vv:25:5: error: left operand to `in` does not match the map key type: expected `string`, not `Int`
2020-05-17 02:13:08 +02:00
23 | println('right')
24 | }
2020-05-17 02:13:08 +02:00
25 | if Int(2) in m {
| ~~~~~~~~~~~
2020-05-17 02:13:08 +02:00
26 | println('yeah')
27 | }
vlib/v/checker/tests/in_mismatch_type.vv:28:5: error: left operand to `in` does not match the array element type: expected `int`, not `string`
2020-05-17 02:13:08 +02:00
26 | println('yeah')
27 | }
2020-05-17 02:13:08 +02:00
28 | if '3' in a_i {
| ~~~~~~~~~~
2020-05-17 02:13:08 +02:00
29 | println('sure')
30 | }
vlib/v/checker/tests/in_mismatch_type.vv:31:5: error: left operand to `in` does not match the array element type: expected `int`, not `string`
2020-05-17 02:13:08 +02:00
29 | println('sure')
30 | }
2020-05-17 02:13:08 +02:00
31 | if '2' in a_i {
| ~~~~~~~~~~
2020-05-17 02:13:08 +02:00
32 | println('all right')
33 | }
vlib/v/checker/tests/in_mismatch_type.vv:34:5: error: left operand to `!in` does not match the array element type: expected `string`, not `int literal`
2020-05-17 17:03:32 +02:00
32 | println('all right')
33 | }
34 | if 1 !in a_s {
| ~~~~~~~~~
2020-05-17 17:03:32 +02:00
35 | println('ok')
36 | }
vlib/v/checker/tests/in_mismatch_type.vv:37:5: error: left operand to `!in` does not match the array element type: expected `int`, not `string`
2020-05-17 17:03:32 +02:00
35 | println('ok')
36 | }
37 | if '1' !in a_i {
| ~~~~~~~~~~~
2020-05-17 17:03:32 +02:00
38 | println('good')
39 | }
vlib/v/checker/tests/in_mismatch_type.vv:41:5: error: left operand to `!in` does not match the map key type: expected `string`, not `int literal`
2020-05-17 17:03:32 +02:00
39 | }
40 |
2020-05-17 17:03:32 +02:00
41 | if 5 !in m {
| ~~~~~~~
2020-05-17 17:03:32 +02:00
42 | println('yay')
43 | }