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
https://github.com/dlang/dmd/pull/6752 - this? https://forum.dlang.org/post/dchjhgdqvwprkrhmsuvn@forum.dlang.org
shared struct Foo { ~this() { } } void main() { Foo x; } This still does not compile
This doesn't compile either now: struct Inner { ~this() {} } struct Outer { shared Inner inner; } void main() { Outer _; }
PR : https://github.com/dlang/dmd/pull/7874
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 <andralex@users.noreply.github.com>