Re: Initializing constant AA and shared problems..

2012-03-18 Thread H. S. Teoh
On Sun, Mar 18, 2012 at 02:50:00PM +0100, simendsjo wrote: > I'm trying to initialize an AA, but initializing at definition > fails, as do in a shared module ctor. > > // how is this now constant? > //shared string[int] aa = [1: "a"]; // Error: non-constant > expression [1:"a"] This is a shortcom

Initializing constant AA and shared problems..

2012-03-18 Thread simendsjo
I'm trying to initialize an AA, but initializing at definition fails, as do in a shared module ctor. // how is this now constant? //shared string[int] aa = [1: "a"]; // Error: non-constant expression [1:"a"] // ok string[int] aa2; static this() { aa2 = [1: "a"]; } // The same with shar