https://issues.dlang.org/show_bug.cgi?id=14246

--- Comment #6 from Walter Bright <[email protected]> ---
Shachar Shemesh wrote this example:

import std.stdio;

struct A {
     int a = 3;

     this( int var ) { a += var; }

     ~this() { writeln("A down ", a); }
}

struct B {
     A a;

     this( int var ) {
         a = A(var+1);
         throw new Exception("An exception");
     }
}

void main() {
     try {
         auto b = B(2);
     } catch( Exception ex ) {
     }
}

I'd expect A's destructor to run, which does not seem to be the case.

--

Reply via email to