mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Improve error on unsigned implicit conversion to signed.
This commit is contained in:
6
test/test_suite/cast/out_of_range_unlong.c3
Normal file
6
test/test_suite/cast/out_of_range_unlong.c3
Normal file
@@ -0,0 +1,6 @@
|
||||
fn int main()
|
||||
{
|
||||
ulong x = ulong.max - 1; // #error: This expression (18446744073709551615) will be implicitly converted to a signed type due to the right-hand side being signed
|
||||
ulong x1 = -1 + ulong.max; // #error: converted to a signed type due to the left-hand side being signed, but the value does
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user