-
-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 15079 - Assertion `fd->semanticRun == PASSsemantic3done' fa…
…iled. It was another surface of issue 15044, and fixed from 2.068.2 - the attribute inference problem had sent a function which is not yet completed semantic analysis to glue layer, and the breaking of internal invariance has been detected.
- Loading branch information
Showing
2 changed files
with
55 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| module imports.a15079; | ||
|
|
||
| Vector!string parseAlgorithmName() | ||
| { | ||
| assert(0); | ||
| } | ||
|
|
||
| struct Vector(ALLOC) | ||
| { | ||
| @disable this(this); | ||
|
|
||
| RefCounted!(Vector, ALLOC) dupr() | ||
| { | ||
| assert(0); | ||
| } | ||
| } | ||
|
|
||
| struct RefCounted(T, ALLOC) | ||
| { | ||
| ~this() | ||
| { | ||
| T* objc; | ||
| .destroy(*objc); | ||
| } | ||
| } | ||
|
|
||
| // ---- | ||
|
|
||
| void _destructRecurse(S)(ref S s) | ||
| if (is(S == struct)) | ||
| { | ||
| static if (__traits(hasMember, S, "__xdtor") && | ||
| __traits(isSame, S, __traits(parent, s.__xdtor))) | ||
| { | ||
| s.__xdtor(); | ||
| } | ||
| } | ||
|
|
||
| void destroy(T)(ref T obj) if (is(T == struct)) | ||
| { | ||
| _destructRecurse(obj); | ||
| () @trusted { | ||
| auto buf = (cast(ubyte*) &obj)[0 .. T.sizeof]; | ||
| auto init = cast(ubyte[])typeid(T).init(); | ||
| if (init.ptr is null) // null ptr means initialize to 0s | ||
| buf[] = 0; | ||
| else | ||
| buf[] = init[]; | ||
| } (); | ||
| } |
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,5 @@ | ||
| module test15079; | ||
|
|
||
| import imports.a15079; | ||
|
|
||
| void main() {} |