Comment #0 by bearophile_hugs — 2013-06-08T14:51:41Z
This issue is borderline between an enhancement request and a bug report.
void main() {
double[3] a;
pragma(msg, typeof(a[] ^^ 2));
float[3] b;
pragma(msg, typeof(b[] ^^ 2));
}
Output:
double[]
float[]
But I think the output should be:
double[3]
float[3]
Keeping the static information of the length of the array is useful for small arrays for successive better optimizations.
Comment #1 by yebblies — 2013-11-21T04:24:44Z
a[] has type double[], s this is already doing what you said.
Comment #2 by bearophile_hugs — 2013-11-21T07:00:07Z
(In reply to comment #1)
> a[] has type double[], s this is already doing what you said.
Then this ER asks for something un-standard and special, even if it needs some hack in the compiler: keeping the compile-time knowledge of the array length is very important to optimize well enough vector operations on fixed sized arrays.
This is a important enhancement request.
Comment #3 by robert.schadek — 2024-12-13T18:08:00Z