truct K { ~this() nothrow {} } void main() { static class C { this(K, int) {} }
static int foo(bool flag) { if (flag) throw new Exception("hello"); return 1; } try { new C(K(), foo(true)); } catch(Exception) { } } Result: object.Exception@test.d(18): helloIf the destructor of K is not marked nothrow the code does not throw an exception. Is this a bug or am I missing something?