redundant_cast
Finds a cast to the type the value already has.
Category complexity, warn by default.
#import "Basic";
main :: () {
x: s32 = 5;
y := cast(s32) x;
print("%\n", y);
}warning[redundant_cast]: `x` is already `s32`
--> example.jai:5:10
|
5 | y := cast(s32) x;
| ^^^^^^^^^^^
|
help: remove the cast
|
5 ~ y := x;
|
= note: `redundant_cast` is `warn` by default#import "Basic";
main :: () {
x: s32 = 5;
y := x;
print("%\n", y);
}Aliases like c_long differ per platform, so the value must be declared with the same type spelling.