-
-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| shared struct Shared | ||
| { | ||
| static Shared make() | ||
| { | ||
| return Shared(); | ||
| } | ||
|
|
||
| ~this() | ||
| { | ||
| } | ||
| } | ||
|
|
||
| shared struct Foo | ||
| { | ||
| ~this() | ||
| { | ||
| } | ||
| } | ||
|
|
||
| struct Inner { ~this() {} } | ||
| struct Outer { shared(Inner) inner; } | ||
|
|
||
| void main() | ||
| { | ||
| Foo x = Foo(); | ||
| auto s = Shared.make(); | ||
| Outer _; | ||
| } |