Closed
Description
let i: u8 = -1
Replacing -1 by 256 gives the following warning:
literal out of range for its type
This could also apply to the code above. Unfortunately even an explicit cast to u8 doesn't remove the second warning.
Note that clang has a related warning:
warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion]
unsigned int i = -1;
~ ^~
Metadata
Metadata
Assignees
Labels
No labels