https://d.puremagic.com/issues/show_bug.cgi?id=11952
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal --- Comment #1 from [email protected] 2014-01-19 12:58:04 PST --- (In reply to comment #0) > http://forum.dlang.org/thread/[email protected] Actually, I'm bumping to bug. Here is a variant of the code in the thread: //---- import std.stdio; struct B { A sup; this(A a) { writeln("Here"); sup = a; writeln("There"); } } struct A { static int count; this() @disable; //Note this this(int n) { writeln("A.this()"); } this(this) { writeln("A.this(this)"); } ~this() { writeln("A.~this()"); } } void main() { A a = A(1); writeln("Start"); B b = B(a); writeln("End"); } //---- A.this() Start A.this(this) Here A.this(this) A.~this() //WHAT??? There A.~this() End A.~this() A.~this() //---- Here, "A" has a disabled default init. Yet in B's constructor, "A.~this()" is clearly called on a default initialized instance, which should *never* (AFAIK) happen unless previously and explicitly initialized to A.init (not the case here). -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
