Thread overview
[Issue 10562] Cannot initialize arrays by an element value when the elements are fixed-length arrays
Nov 08, 2019
Ali Cehreli
Nov 21, 2019
Dlang Bot
Nov 22, 2019
Dlang Bot
November 08, 2019
https://issues.dlang.org/show_bug.cgi?id=10562

--- Comment #2 from Ali Cehreli <acehreli@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.

--
November 21, 2019
https://issues.dlang.org/show_bug.cgi?id=10562

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@benjones created dlang/dmd pull request #10600 "Fix issue 10562 dont flatten arrays to 1D when " fixing this issue:

- Fix issue 10562 dont flatten arrays to 1D when being assigned to an array

https://github.com/dlang/dmd/pull/10600

--
November 22, 2019
https://issues.dlang.org/show_bug.cgi?id=10562

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #10600 "Fix issue 10562 dont flatten arrays to 1D when " was merged into master:

- 7c900d46148b0020b7f7e3b2c569faaf49869694 by Ben Jones:
  Fix issue 10562 dont flatten arrays to 1D when being assigned to an array

https://github.com/dlang/dmd/pull/10600

--