I am unable to define a destructor in a struct which may or may not be shared. Possible duplicate of issue #12004, because if Macro's suggestion were followed, it would solve the problem for my use case. struct Foo { ~this () {} } struct Bar { shared ~this () {} } struct Baz { ~this () {} shared ~this () {} // source/main.d(44): Error: destructor main.Baz.~this conflicts with destructor main.Baz.~this at source/main.d(43) } void main () { Foo foo; shared Bar bar; shared Foo s_foo; // source/main.d(51): Error: non-shared method main.Foo.~this is not callable using a shared object Bar n_bar; // source/main.d(52): Error: shared method main.Bar.~this is not callable using a non-shared object }
Yes, that was my exact same problem. I just jumped right to conclusions in issue #12004.
*** This issue has been marked as a duplicate of issue 8295 ***