| 1 | vlib/v/checker/tests/map_ops.vv:3:7: error: invalid key: expected `int`, not `rune` |
| 2 | 1 | fn test_map() { |
| 3 | 2 | mut m := map[int]string{} |
| 4 | 3 | _ = m[`!`] |
| 5 | | ~~~~~ |
| 6 | 4 | m['hi'] = 8 |
| 7 | 5 | m[&m] += 4 |
| 8 | vlib/v/checker/tests/map_ops.vv:4:3: error: invalid key: expected `int`, not `string` |
| 9 | 2 | mut m := map[int]string{} |
| 10 | 3 | _ = m[`!`] |
| 11 | 4 | m['hi'] = 8 |
| 12 | | ~~~~~~ |
| 13 | 5 | m[&m] += 4 |
| 14 | 6 | a := 10 |
| 15 | vlib/v/checker/tests/map_ops.vv:4:12: error: cannot assign to `m['hi']`: expected `string`, not `int literal` |
| 16 | 2 | mut m := map[int]string{} |
| 17 | 3 | _ = m[`!`] |
| 18 | 4 | m['hi'] = 8 |
| 19 | | ^ |
| 20 | 5 | m[&m] += 4 |
| 21 | 6 | a := 10 |
| 22 | vlib/v/checker/tests/map_ops.vv:5:3: error: invalid key: expected `int`, not `&map[int]string` |
| 23 | 3 | _ = m[`!`] |
| 24 | 4 | m['hi'] = 8 |
| 25 | 5 | m[&m] += 4 |
| 26 | | ~~~~ |
| 27 | 6 | a := 10 |
| 28 | 7 | ptr := &a |
| 29 | vlib/v/checker/tests/map_ops.vv:5:11: error: invalid right operand: string += int literal |
| 30 | 3 | _ = m[`!`] |
| 31 | 4 | m['hi'] = 8 |
| 32 | 5 | m[&m] += 4 |
| 33 | | ^ |
| 34 | 6 | a := 10 |
| 35 | 7 | ptr := &a |
| 36 | vlib/v/checker/tests/map_ops.vv:5:11: error: cannot assign to `m[&m]`: expected `string`, not `int literal` |
| 37 | 3 | _ = m[`!`] |
| 38 | 4 | m['hi'] = 8 |
| 39 | 5 | m[&m] += 4 |
| 40 | | ^ |
| 41 | 6 | a := 10 |
| 42 | 7 | ptr := &a |
| 43 | vlib/v/checker/tests/map_ops.vv:9:3: error: invalid key: expected `int`, not `&int`; did you mean `n[*ptr]`? |
| 44 | 7 | ptr := &a |
| 45 | 8 | mut n := map[int]int{} |
| 46 | 9 | n[ptr] = 1 |
| 47 | | ~~~~~ |
| 48 | 10 | _ = ptr in n |
| 49 | 11 | } |
| 50 | vlib/v/checker/tests/map_ops.vv:10:6: error: left operand to `in` does not match the map key type: expected `int`, not `&int` |
| 51 | 8 | mut n := map[int]int{} |
| 52 | 9 | n[ptr] = 1 |
| 53 | 10 | _ = ptr in n |
| 54 | | ~~~~~~~~ |
| 55 | 11 | } |
| 56 | |