-
-
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.
Merge pull request #5172 from 9rnsr/fix15177
[REG2.069.0-b1] Issue 15177 - mixin + traits issue with 2.069 beta 1
- Loading branch information
Showing
3 changed files
with
45 additions
and
6 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,9 @@ | ||
| module imports.test15117a; | ||
|
|
||
| struct AssertResult {} | ||
|
|
||
| auto test_usr_1() | ||
| { | ||
| // 2. generate TyepInfoStructDeclaration | ||
| auto x = typeid(AssertResult); | ||
| } |
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,23 @@ | ||
| // REQUIRED_ARGS: -o- | ||
| // PERMUTE_ARGS: | ||
| // EXTRA_SOURCES: imports/test15117a.d | ||
|
|
||
| import users = imports.test15117a; | ||
|
|
||
| void RunApiTest(T...)() | ||
| { | ||
| foreach (name; __traits(allMembers, users)) | ||
| { | ||
| // 3. list the name of TyepInfoStructDeclaration, | ||
| // but it's just internal symbol and invisible. | ||
| mixin("alias func = users . " ~ name ~ ";"); | ||
| } | ||
| } | ||
|
|
||
| void main() | ||
| { | ||
| // 1. run semantic3 of users.test_usr_1 | ||
| users.test_usr_1(); | ||
|
|
||
| RunApiTest!(); | ||
| } |