Reduced test case:
struct S { int[int] a; }
void baz(ref int[int] x)
{
auto m = x.dup;
}
int bar()
{
S s;
baz(s.a);
return 1;
}
static assert(bar());
---
Applies to any case where you pass an AA by reference _when it is null_, and then duplicate it. <sigh> This is the bizarre "magic null" semantics that happen only with AAs. It causes dozens of special cases.
Comment #2 by k.hara.pg — 2014-04-11T00:39:57Z
The original case has worked from 2.063.
The reduced test case in comment#1 works from 2.066 git-head, because AA implementation is changed to UFCS style.