Comment #0 by bearophile_hugs — 2013-10-01T18:35:05Z
struct Foo {
int[3] a;
}
void main() {
Foo f1 = {[10, 20]}; // No error.
Foo f2 = Foo([10, 20]); // Line 6, Error.
}
DMD 2.064 alpha gives:
temp.d(6): Error: cannot implicitly convert expression ([10, 20]) of type int[] to int[3]
I think D should accept both or refuse both. Probably it should refuse both.
See also issue 481
Comment #1 by andrej.mitrovich — 2013-10-01T18:39:20Z
Also similar to Issue 3849.
Comment #2 by robert.schadek — 2024-12-13T18:12:11Z