Bug 17970 – shared struct destructor doesn't compile anymore

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-11-06T15:33:08Z
Last change time
2018-02-12T16:39:14Z
Assigned to
No Owner
Creator
Radu Racariu
See also
https://issues.dlang.org/show_bug.cgi?id=17658

Comments

Comment #0 by radu.racariu — 2017-11-06T15:33:08Z
The following: +++++foo.d++++++ shared struct Shared { static shared(Shared) make() { return shared(Shared)(); } ~this() { } } void main() { auto s = Shared.make(); } +++++++++++ Compiles with 2.072 and 2.074, fails with upward versions including 2.077 with this error: Error: shared method foo.Shared.~this is not callable using a non-shared object
Comment #1 by dfj1esp02 — 2017-11-07T14:36:49Z
Comment #2 by alex.jercaianu — 2018-01-16T10:57:55Z
shared struct Foo { ~this() { } } void main() { Foo x; } This still does not compile
Comment #3 by atila.neves — 2018-01-30T10:02:46Z
This doesn't compile either now: struct Inner { ~this() {} } struct Outer { shared Inner inner; } void main() { Outer _; }
Comment #4 by razvan.nitu1305 — 2018-02-12T12:54:44Z
Comment #5 by github-bugzilla — 2018-02-12T16:39:13Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/8a61a31749272ec0ebe10f826ab696510e5ed154 Fix Issue 17970 - shared struct destructor doesn't compile anymore https://github.com/dlang/dmd/commit/2c70923e3c369148b24c75be6e362c1231ae620a Merge pull request #7874 from RazvanN7/Issue_17970 Fix Issue 17970 - shared struct destructor doesn't compile anymore merged-on-behalf-of: Andrei Alexandrescu <[email protected]>