--- Comment #1 from Jose Garcia <> 2011-06-19 12:45:41 PDT ---
Err -- Hit submit without a description...

I am going to assume that this was not already filed. If so please accept my

If you create an AA that points to a struct the is not initialized properly. In
other word it is not the same as S.init. If this stays that way in can
completely confuse the dtor. For example:

import std.stdio;

struct Bug
   this(this) { writefln("%s postblit ctor called", var); }
   void opAssign(Bug rhs) { writefln("%s opAssign called", var); }
   ~this() { writefln("%s dtor called", var); }

   int var = 0;

void main()
   Bug[int] map;
      map[0] = Bug(1);

This yields the following output (you need -O or you will hit bug 6177):

dmd -w -O map_test.d && ./map_test
3 opAssign called
1 dtor called
3 dtor called

Where in the world is 3 coming from? You output may be slightly different.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to