Unsafe Enum Assignment
At runtime there is no way to guarantee that a non-const reference will not change its value to something out-of-bounds for enums. For example consider the following
PROGRAM main
VAR
zero : DINT := 0;
color : (red := 0, green := 1, blue := 2);
END_VAR
zero := 10;
color := zero; // Invalid because `color` accepts values from 0 to 2, but we assigned 10 to it
END_PROGRAM