stack trace
object.Error@(0): Access Violation
----------------
0x0040322F in _aaGetImpl at D:\D\digger\repo\druntime\src\rt\aaA.d(215)
0x00402381 in _aaGetY at D:\D\digger\repo\druntime\src\rt\aaA.d(189)
0x0040203D in void test.__unittestL1_1() at D:\D\test.d(3)
0x00402068 in void test.__modtest() at D:\D\test.d(4)
Note, the unittest is incidental, it happens with just:
void main()
{
shared int[int] aa;
aa[1] = 1;
}
Comment #4 by k.hara.pg — 2015-02-17T15:14:27Z
(In reply to Steven Schveighoffer from comment #2)
> It's because of the precise scanning. DMD passes the type info to _aaGetY,
> which is actually a wrapper TypeInfo_Shared, but the function is prototyped
> as accepting TypeInfo_AssociativeArray.
>
> See my comment here:
> https://github.com/D-Programming-Language/druntime/pull/1037#issuecomment-
> 74678635
The root is mostly same with issue 14038.
A shared AA doesn't make too much sense BTW, because you'll need some additional synchronization mechanism if you want to modify it.
And if you use a http://dlang.org/phobos/core_sync_rwmutex.html#.ReadWriteMutex for example you only need tail-shared for the value type.
Comment #7 by github-bugzilla — 2015-02-19T08:53:56Z