62 lines
2.4 KiB
Plaintext
62 lines
2.4 KiB
Plaintext
vlib/v/checker/tests/compare_unsigned_signed.vv:2:14: error: unsigned integer cannot be compared with negative value
|
|
1 | fn main() {
|
|
2 | if u32(1) < -1 {
|
|
| ~~
|
|
3 | println('unexpected')
|
|
4 | }
|
|
vlib/v/checker/tests/compare_unsigned_signed.vv:6:5: error: unsigned integer cannot be compared with negative value
|
|
4 | }
|
|
5 |
|
|
6 | if -1 > u32(1) {
|
|
| ~~
|
|
7 | println('unexpected')
|
|
8 | }
|
|
vlib/v/checker/tests/compare_unsigned_signed.vv:10:16: error: `u8` cannot be compared with negative value
|
|
8 | }
|
|
9 | // unsigned == literal
|
|
10 | _ = u8(-1) == -1 // false!
|
|
| ~~
|
|
11 | _ = -1 == u16(-1) // false!
|
|
12 |
|
|
vlib/v/checker/tests/compare_unsigned_signed.vv:11:6: error: negative value cannot be compared with `u16`
|
|
9 | // unsigned == literal
|
|
10 | _ = u8(-1) == -1 // false!
|
|
11 | _ = -1 == u16(-1) // false!
|
|
| ~~
|
|
12 |
|
|
13 | // smaller unsigned == signed, OK
|
|
vlib/v/checker/tests/compare_unsigned_signed.vv:18:12: error: `i8` cannot be compared with `u16`
|
|
16 |
|
|
17 | // smaller signed == unsigned, NG
|
|
18 | _ = i8(0) == u16(0)
|
|
| ~~
|
|
19 | _ = i16(0) != u32(0)
|
|
20 | _ = int(0) == u64(0)
|
|
vlib/v/checker/tests/compare_unsigned_signed.vv:19:13: error: `i16` cannot be compared with `u32`
|
|
17 | // smaller signed == unsigned, NG
|
|
18 | _ = i8(0) == u16(0)
|
|
19 | _ = i16(0) != u32(0)
|
|
| ~~
|
|
20 | _ = int(0) == u64(0)
|
|
21 | _ = i32(0) == u64(0) // FIXME
|
|
vlib/v/checker/tests/compare_unsigned_signed.vv:20:13: error: `int` cannot be compared with `u64`
|
|
18 | _ = i8(0) == u16(0)
|
|
19 | _ = i16(0) != u32(0)
|
|
20 | _ = int(0) == u64(0)
|
|
| ~~
|
|
21 | _ = i32(0) == u64(0) // FIXME
|
|
22 | // swap order
|
|
vlib/v/checker/tests/compare_unsigned_signed.vv:23:13: error: `u16` cannot be compared with `i8`
|
|
21 | _ = i32(0) == u64(0) // FIXME
|
|
22 | // swap order
|
|
23 | _ = u16(0) == i8(0)
|
|
| ~~
|
|
24 | _ = u64(0) == i16(0)
|
|
25 | }
|
|
vlib/v/checker/tests/compare_unsigned_signed.vv:24:13: error: `u64` cannot be compared with `i16`
|
|
22 | // swap order
|
|
23 | _ = u16(0) == i8(0)
|
|
24 | _ = u64(0) == i16(0)
|
|
| ~~
|
|
25 | }
|