www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - What's the rationale behind partial initialization of static arrays ?

I'd like to know why the things work like they are working now:


===
module a;
immutable int[42] a = [42]; // OK
static immutable int[42] b = [42]; // OK

void main()
{
     immutable int[42] c = [42]; // Not allowed
}
===

1/ this is error prone
2/ the semantic is not consistent (allowed here, forbidden there)
Apr 29 2017