I was confused by this message:
a[x..y] = b[];
object.Error@(0): Array lengths don't match for copy: 3932160 != 1310720
I looked around wondering how the heck x..y had become 3932160, only to realize that the order of "3932160 != 1310720" doesn't match the order of a[] = b[], it's the other way around.
It seems to me like printing the lengths in the same order as the source code assignment would make more intuitive sense.
Comment #1 by bitworld — 2018-09-11T02:33:32Z
Here is another test:
__gshared string[] zeros;
shared static this() {
zeros[] = new string[64]; // There is no callstatck info.
// It just give these error:
// object.Error@(0): Array lengths don't match for copy: 64 != 0
// If I have a big source file, it really hard to locate the error.
}
void main()
{
// zeros[] = new string[64]; // Can get the callstatck info
}
Comment #2 by robert.schadek — 2024-12-13T18:59:01Z