For some reason, new array[2] = anotherArray; is wrong and gives an error: must be a constant expression; assumed zero. I have to then resort to this: new array[2]; array2 = anotherArray;. which achieves the desired result. Now, I understand this was made on purpose, but does it really need to be like that? This just complicates syntax for something that is valid in virtually any other language.
Minimal complete verifiable example (MCVE):
new anotherArray[2] = {1, 2};
main()
{
new array[2] = anotherArray; // must be a constant expression; assumed zero
}
Issue description:
For some reason,
new array[2] = anotherArray;
is wrong and gives an error:must be a constant expression; assumed zero
. I have to then resort to this:new array[2]; array2 = anotherArray;
. which achieves the desired result. Now, I understand this was made on purpose, but does it really need to be like that? This just complicates syntax for something that is valid in virtually any other language.Minimal complete verifiable example (MCVE):