| 1 | vlib/v/checker/tests/compare_unsigned_signed.vv:2:14: error: unsigned integer cannot be compared with negative value |
| 2 | 1 | fn main() { |
| 3 | 2 | if u32(1) < -1 { |
| 4 | | ~~ |
| 5 | 3 | println('unexpected') |
| 6 | 4 | } |
| 7 | vlib/v/checker/tests/compare_unsigned_signed.vv:6:5: error: unsigned integer cannot be compared with negative value |
| 8 | 4 | } |
| 9 | 5 | |
| 10 | 6 | if -1 > u32(1) { |
| 11 | | ~~ |
| 12 | 7 | println('unexpected') |
| 13 | 8 | } |
| 14 | vlib/v/checker/tests/compare_unsigned_signed.vv:10:16: error: `u8` cannot be compared with negative value |
| 15 | 8 | } |
| 16 | 9 | // unsigned == literal |
| 17 | 10 | _ = u8(-1) == -1 // false! |
| 18 | | ~~ |
| 19 | 11 | _ = -1 == u16(-1) // false! |
| 20 | 12 | |
| 21 | vlib/v/checker/tests/compare_unsigned_signed.vv:11:6: error: negative value cannot be compared with `u16` |
| 22 | 9 | // unsigned == literal |
| 23 | 10 | _ = u8(-1) == -1 // false! |
| 24 | 11 | _ = -1 == u16(-1) // false! |
| 25 | | ~~ |
| 26 | 12 | |
| 27 | 13 | // smaller unsigned == signed, OK |
| 28 | vlib/v/checker/tests/compare_unsigned_signed.vv:18:12: error: `i8` cannot be compared with `u16` |
| 29 | 16 | |
| 30 | 17 | // smaller signed == unsigned, NG |
| 31 | 18 | _ = i8(0) == u16(0) |
| 32 | | ~~ |
| 33 | 19 | _ = i16(0) != u32(0) |
| 34 | 20 | _ = int(0) == u64(0) |
| 35 | vlib/v/checker/tests/compare_unsigned_signed.vv:19:13: error: `i16` cannot be compared with `u32` |
| 36 | 17 | // smaller signed == unsigned, NG |
| 37 | 18 | _ = i8(0) == u16(0) |
| 38 | 19 | _ = i16(0) != u32(0) |
| 39 | | ~~ |
| 40 | 20 | _ = int(0) == u64(0) |
| 41 | 21 | _ = i32(0) == u64(0) // FIXME |
| 42 | vlib/v/checker/tests/compare_unsigned_signed.vv:20:13: error: `int` cannot be compared with `u64` |
| 43 | 18 | _ = i8(0) == u16(0) |
| 44 | 19 | _ = i16(0) != u32(0) |
| 45 | 20 | _ = int(0) == u64(0) |
| 46 | | ~~ |
| 47 | 21 | _ = i32(0) == u64(0) // FIXME |
| 48 | 22 | // swap order |
| 49 | vlib/v/checker/tests/compare_unsigned_signed.vv:21:13: error: `i32` cannot be compared with `u64` |
| 50 | 19 | _ = i16(0) != u32(0) |
| 51 | 20 | _ = int(0) == u64(0) |
| 52 | 21 | _ = i32(0) == u64(0) // FIXME |
| 53 | | ~~ |
| 54 | 22 | // swap order |
| 55 | 23 | _ = u16(0) == i8(0) |
| 56 | vlib/v/checker/tests/compare_unsigned_signed.vv:23:13: error: `u16` cannot be compared with `i8` |
| 57 | 21 | _ = i32(0) == u64(0) // FIXME |
| 58 | 22 | // swap order |
| 59 | 23 | _ = u16(0) == i8(0) |
| 60 | | ~~ |
| 61 | 24 | _ = u64(0) == i16(0) |
| 62 | 25 | } |
| 63 | vlib/v/checker/tests/compare_unsigned_signed.vv:24:13: error: `u64` cannot be compared with `i16` |
| 64 | 22 | // swap order |
| 65 | 23 | _ = u16(0) == i8(0) |
| 66 | 24 | _ = u64(0) == i16(0) |
| 67 | | ~~ |
| 68 | 25 | } |
| 69 | |