Improve error on unsigned implicit conversion to signed.

This commit is contained in:
Christoffer Lerno
2025-07-09 02:49:19 +02:00
parent 1d4ad5f1d5
commit 83fd24faa2
3 changed files with 29 additions and 0 deletions

View 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;
}