rusty
rusty copied to clipboard
Overflow checks in bodies are missing
Is your feature request related to a problem? Please describe. The following code
FUNCTION main : DINT
VAR
x : SINT := 1000000;
END_VAR
x := 1000000;
END_FUNCTION
will return an overflow error for the assignment in the VAR-block, but not for the assignment in the implementation / body. Specficially when compiling the code we get the following output
warning: This will overflow for type SINT
┌─ target/demo.st:3:21
│
3 │ x : SINT := 1000000;
│ ^^^^^^^ This will overflow for type SINT
but the one in the body is missing.
Describe the solution you'd like Check overflows (where possible) in the body