79717705

Date: 2025-07-28 17:51:11
Score: 0.5
Natty:
Report link

When you declare an array variable of a type it will only handle that type specified, it will just do an implicit type convertion, if you want to enforce the type then you must do it on the place you are using the array or you may insert using the index, since that way it is checked at save/compile time.

Local Array of String &myArray = CreateArrayRept("", 0);

&myArray.push(1); // This compiles (add member)
&myArray[2] = "1"; // This compiles (add member)
&myArray[3] = "1"; // This compiles (add member)
&myArray[4] = 1; // This doesn't
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (1):
Posted by: Guillermo-Santos