Merge pull request #877 from 9rnsr/fix13078

[REG2.066a] Issue 13078 - [dmd 2.066-b2] AA rehash failed with shared
Merge pull request #880 from 9rnsr/2.066

Cherry-picking commits from master to 2.066 branch (for beta3)