← Back to index
|
Original Bugzilla link
Bug 13653 – Better error messages for mismatched array literals
Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2014-10-25T14:38:40Z
Last change time
2024-12-13T18:32:14Z
Assigned to
No Owner
Creator
bearophile_hugs
Moved to GitHub: dmd#18902 →
Comments
Comment #0
by bearophile_hugs — 2014-10-25T14:38:40Z
void main() { uint[1][2] arr1 = [[0, 0]]; int[2] arr2 = [1.5, 2.5]; } DMD 2.067alpha gives a strange error messages: test.d(2,23): Error: cannot implicitly convert expression ([[0, 0]]) of type int[][] to uint[] test.d(3,19): Error: cannot implicitly convert expression ([1.5, 2.5]) of type double[] to int[] But I suggest to give more clear error message, something like: test.d(2,23): Error: array sizes mismatch, cannot implicitly convert array literal of shape (2, 1) to shape (1, 2) test.d(3,19): Error: cannot implicitly convert expression ([1.5, 2.5]) of type double[] to int[2]
Comment #1
by robert.schadek — 2024-12-13T18:32:14Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/18902
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB