[Issue 15359] DMD incorrectly identifies type of multidimensional array

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Nov 18 13:22:05 PST 2015


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

--- Comment #2 from Jack Stouffer <jack at jackstouffer.com> ---
(In reply to Tanel Tagaväli from comment #1)
> I believe you mean "int[2][5] data = ...".

Yes I did. I improperly reduced a bug I ran into.

Here is a better illustration of the problem

------
void main() {
    int[][] data = [[0, 1], [2, 3], [4, 5], [6, 7], [8, 9]];
    int[2][5] d = data;
}
------

Maybe it's just a question of a bad error message, because if taking the data
from a dynamic array and saving it into a static array is not allowed it should
say something like

------
Error: cannot implicitly convert expression (data) of type int[][] to int[2][5]
------

But instead it says

------
Error: cannot implicitly convert expression (data) of type int[][] to int[]
------

--


More information about the Digitalmars-d-bugs mailing list