Arrays do not enforce type consistency when reading from an array.
For example, consider the following code
int testInt = 2; Array testArray = [testInt]; string testString = testArray[1]; return testString;
In FlexSim 2021, this returns the string "2". (In FlexSim 2018, this returns a null string.)
However, consider the following code
int testInt = 2; string testString = testInt; return testString;
If you run that code (in either 2018 or 2021), you get this error message: "Could not resolve correct operator for = operation. Left side type is string&, right type is int&"
In my opinion, it would be better if running the first block of code returned that same error message. I find implicit type conversion like that to be quite dangerous, as it makes it easy for bugs to go unnoticed.
Importantly, this does not work in reverse. If you try to cast a string representation of an integer (e.g. "2") to an integer via an array, the integer will be 0, not the integer value represented by the string.