On Thu, Mar 22, 2012 at 09:29:36PM -0700, H. S. Teoh wrote: > On Thu, Mar 22, 2012 at 10:25:04PM +0100, Andrej Mitrovic wrote: > > On 3/22/12, H. S. Teoh <hst...@quickfur.ath.cx> wrote: > > > Maybe this needs a ctor? > > > > Yeah probably. I really don't know when opAssign or the ctor are > > called (especially with more complex types with alias this). Maybe > > someone knows this or it's in the spec but I haven't read about it. > > Gah. I tried adding a ctor but it still doesn't work. Compiler > complains: > > Error: Integer constant expression expected instead of "abc" > > for AA!(string,int) bb = ["abc":123]; > > I'm guessing the compiler thinks the literal is an array literal, or > maybe something went awry with the internal AA hacks that it currently > has. So we can't have this nice syntax until druntime/dmd integration. [...]
Seems to be related to this bug: http://d.puremagic.com/issues/show_bug.cgi?id=6469 T -- The right half of the brain controls the left half of the body. This means that only left-handed people are in their right mind. -- Manoj Srivastava