https://issues.dlang.org/show_bug.cgi?id=15359
Alex Parrill <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #3 from Alex Parrill <[email protected]> --- (In reply to Jack Stouffer from comment #2) > (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[] > ------ Fixed-sized arrays (like `int[2][5]`) have different semantics than slices (like `int[][]`); you'll have to assign the elements manually. --
