E1140: operands of different integer types
An arithmetic, bitwise or comparison operator needs two operands of the same integer type.
An arithmetic, bitwise or comparison operator needs two operands of the same
integer type. u8, u32 and Int are three different types, so a u8 cannot
be added to a u32. Actus has no implicit numeric conversion, and the width of
the arithmetic must be visible in the code. ADR-0119 sets this rule for
arithmetic and bitwise operators, and ADR-0120 sets it for comparisons. An
unsuffixed literal takes the type of the other operand, so small + 1 is
accepted.
Example
Fix
Convert one operand with as so both sides have the same type. The conversion
is checked and traps if the value does not fit.
Run actus explain E1140 in your terminal to read this entry offline. Browse Modules & rules or all error codes.