D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10264 - Some missing implicit conversions in dynamic array of dynamic array literals
Summary: Some missing implicit conversions in dynamic array of dynamic array literals
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P3 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2013-06-04 04:57 UTC by bearophile_hugs
Modified: 2024-12-13 18:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2013-06-04 04:57:58 UTC
void main() {
    double[] a = [1.0, 2, 3];                   // OK
    double[][] m1 = [[1.0, 2.0], [3, 4]];       // error
     float[][] m2 = [[1.0, 2.0], [3.0, 4.0]];   // OK
     float[][] m3 = [[1.0f, 2.0f], [3.0, 4.0]]; // error
}


DMD 2.064alpha gives:

temp.d(3): Error: incompatible types for (([1.00000, 2.00000]) : ([3, 4])): 'double[]' and 'int[]'
temp.d(5): Error: incompatible types for (([1.00000F, 2.00000F]) : ([3.00000, 4.00000])): 'float[]' and 'double[]'
Comment 1 dlangBugzillaToGithub 2024-12-13 18:07:38 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18599

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB