[Issue 11105] Error on struct with multidimentional static array initialization from its element

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 23 03:38:46 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=11105



--- Comment #1 from Don <clugdbug at yahoo.com.au> 2013-09-23 03:38:45 PDT ---
> Not sure about validity of the issue as documentation doesn't provide exact
implicit conversions on struct initialization.

I'm not sure either.

struct S
{
    int [2][1] xx = [1, 2];
}

prints:
test.d(3): Error: array initializer has 2 elements, but array length is 1.

So the struct literal behaviour is consistent with that. Yet,

void main()
{
    int [2][1] xx = [1, 2];
}

is accepted. I think the difference in behaviour is hard to justify.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list