[Issue 10562] Cannot initialize arrays by an element value when the elements are fixed-length arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 8 06:45:00 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=10562

--- Comment #2 from Ali Cehreli <acehreli at yahoo.com> ---
I looked a little bit at function 'visit(AssignExp exp)' inside
dmd/src/dmd/expressionsem.d. I think this is related to the fact that a static
array initialization's left-hand expression treated as a dynamic array. This is
evident in the following error message:

  int[3][2][1] arr = 1.5; // Error: cannot implicitly convert expression `1.5`
of type `double` to `int[]`

Note how the error message says int[] instead of int[3][2][1]. I suspect this
is a bug due to code reuse in implementation.

--


More information about the Digitalmars-d-bugs mailing list