D-Programming-Language/dmd — pull request #3892 by IgorStepanov (2014-08-23 10:50:53+00:00)
Title: [new AA] use aaLiteral and aaInit

This PR depends on D-Programming-Language/druntime/pull/933
object.aaLiteral should be defined in object.d and return constructed AA object.
object.aaInit should return `.init` value for AA.
New AA implementation use non-zero null value for AA. `.init` value in new AA contains pointer to a function table: when we add element to the null AA, we should know really type of AA to call functions like _aaGetX, without TypeInfo using.

This solution causes one behaviour change:
when AA defined as union-member, we can't properly initialize it:
```
union Foo
{
int[int] aa;
string[string] bb;
}
```
Now, AA inside union initializes with zero, and if we need to use aa-member we should assign `.init` to it:
{
Foo f;
f.aa = (int[int]).init;
f.aa[3] = 3;
...
f.bb = (string[string]).init;
f.bb["foo"] = "bar";
...
}

Another minor behaviour changes:
`test/runnable/imports/link12144a.d`:
If struct uses as AA key, `opEquals` should take `const` this and rvl. Same for `toHash`.

`test/runnable/nulltype.d`:
when `typeof(null) delegate()` return value assigns to AA, AA initializes by zero
```
typeof(null) foo()
{
return null;
}

int[int] aa = foo(); //aa initialized by zero and should be initialized by (int[int]).init
```

`test/runnable/test13117.d`:
`test/runnable/test13117b.d`:
exe-size can be larger then early, because new AA use templates.

`test/runnable/sdtor.d`:
`test/runnable/testaa.d`:
`test/runnable/testaa2.d`:
New implenetation calls postblit for keys (as needed), and may calls excess postblit in aa literal (because D hasn't rvalue-ref yet).