Summary: incorrect code generated for assignment to assoc array
           Product: D
           Version: 2.029
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

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) {
void main() {
     X [int] xs;
     xs[0] = X();
     assert(xs[0].i == 1);


Reply via email to