Open
Description
Currently there is no validation in place for variables being initialized in variable blocks. Trying to initialize a variable with an invalid type will fail during codegen, but not be reported beforehand.
e.g.:
VAR_GLOBAL
a : (red, yellow, green) := (1, 2, 3);
b : INT := 'wrong type';
c : STRING := 10(1000);
d : ARRAY[0..1] OF WSTRING := 1000;
END_VAR
FUNCTION main : DINT
VAR
a : (red, yellow, green) := (1, 2, 3);
b : INT := 'wrong type';
c : STRING := 10(1000);
d : ARRAY[0..1] OF WSTRING := 1000;
END_VAR
END_FUNCTION