rusty
rusty copied to clipboard
better error message for array of struct initialization
if we write the wrong parentheses for the array initialization, we get only a general error message
PROGRAM mainProg
VAR
testARR : struct_io := [val1:=TRUE,val2:=1]; //not ok
testARR : struct_io := (val1:=TRUE,val2:=1); //OK
END_VAR
END_PROGRAM
TYPE struct_io :
STRUCT
val1 : BOOL;
val2 : INT;
val3 : SINT;
END_STRUCT
END_TYPE
error: Some initial values were not generated Error: E071: Compilation aborted due to previous errors
We should return an invalid assignment error here and also give a suggestion to replace [] with () as is the case with array initializers.