http://d.puremagic.com/issues/show_bug.cgi?id=2938
Summary: incorrect code generated for assignment to assoc array element Product: D Version: 2.029 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzi...@digitalmars.com ReportedBy: crist...@zerobugs.org This code causes a range violation exception. It goes away if the postblit operator is commented away. The root cause is in the front-end which generates code that gets the element at key zero (to create a temp as argument to opAssign). I was able to work around it in my back-end for .NET, but then the assertion fails, because the front-end does not generate the call to postblit. struct X { int i; this(this) { ++i; } } void main() { X [int] xs; xs[0] = X(); assert(xs[0].i == 1); } --