Open Y-Less opened 3 years ago
If the number of specified elements is not a multiple of cell size (4), e.g.:
new arr[] = !{ 0, 1, 2 };
should we treat this as an error or rather silently fill the remaining positions with zeroes? (I'm pretty sure it should be the second option, as there's no similar requirement for the number of characters in packed strings, but asking just in case).
Also, we'll probably need a new diagnostic for situations when the specified value is out of representable range, e.g.:
new array[] = !{ 253, 254, 255, 256 }; // would compile as !{ 253, 254, 255, 0 }
I'd say fill it with 0s. That's already the way other arrays work when you don't specify everything:
new arr[10] = {1, 2};
This issue has been automatically marked as stale because it has not had recent activity.
Issue description:
Minimal complete verifiable example (MCVE):
Pretty obvious I think. Just allows declaring packed arrays, similar to packed strings.
Workspace Information: