Wrong lowering for a[b][c]++

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Mar 22 22:24:57 PDT 2012


On Fri, Mar 23, 2012 at 06:11:05AM +0100, Andrej Mitrovic wrote:
[...]
> Btw, want to see a magic trick? Put this into your hash:
> 
> this(AA)(AA aa)
>     if (std.traits.isAssociativeArray!AA
>         && is(KeyType!AA == keytype)
>         && is(ValueType!AA == valuetype))
> {
>     foreach (key, val; aa)
>         this[key] = val;
> }
> 
> And theeeen..... *drumroll*:
> 
> AA!(string,int) bb = cast()["abc":123];
> 
> badoom-tshhh. LOL!

WAT?! What on earth is "cast()" supposed to mean?? That's just screwed
up. Well anyway, I pushed the change to github, since it at least makes
literal sliiightly more usable. Have fun! :-)


T

-- 
What's a "hot crossed bun"? An angry rabbit.


More information about the Digitalmars-d mailing list