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

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Mar 22 11:04:09 PDT 2012


On 3/22/12, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> Your test files work ok.

Well unfortunately isAssociativeArray from std.traits fails on your
hashes (reasonable, since it calls __traits internally and has no way
of knowing about external hashes).

I also can't use your hashes with some helper functions that I use:

template ValueType(V : V[K], K) {
    alias V ValueType;
}

The function that needs the above is:

void addKey(AA, Key)(ref AA hash, Key key)
  if (isAssociativeArray!AA && is(KeyType!AA == Key))
{
    hash[key] = (ValueType!AA).init;
}

I can temporarily remove those constraints, but how do I extract the
value type of your hash?


More information about the Digitalmars-d mailing list