autocast_used
Finds xx, the automatic cast, outside a call's arguments.
Category restriction, allow by default.
Off by default; the example is shown with the rule enabled.
#import "Basic";
main :: () {
big: s64 = 200;
small: u8 = xx big;
print("%\n", small);
}warning[autocast_used]: `xx` leaves the target type to the context (`s64` to `u8`)
--> example.jai:5:17
|
5 | small: u8 = xx big;
| ^^
|
help: write `cast(u8)` to say so
|
5 ~ small: u8 = cast(u8) big;
|#import "Basic";
main :: () {
big: s64 = 200;
small := cast(u8) big;
print("%\n", small);
}xx takes its target type from the context, so the line does not say what the value becomes, and changing the type on the left silently changes the conversion on the right.