Bug 13174 – shared ~this() conflicts with this()

Status
RESOLVED
Resolution
DUPLICATE
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-07-21T01:08:00Z
Last change time
2016-02-12T17:32:44Z
Assigned to
nobody
Creator
vlevenfeld

Comments

Comment #0 by vlevenfeld — 2014-07-21T01:08:26Z
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 }
Comment #1 by Marco.Leise — 2014-10-17T15:01:33Z
Yes, that was my exact same problem. I just jumped right to conclusions in issue #12004.
Comment #2 by r9shackleford — 2016-02-12T17:32:44Z
*** This issue has been marked as a duplicate of issue 8295 ***