-
-
Notifications
You must be signed in to change notification settings - Fork 609
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 #8885 from RazvanN7/Alternate_16082
Fix Issues 16082 and 16086
- Loading branch information
Showing
8 changed files
with
206 additions
and
20 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
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
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
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,60 @@ | ||
| // REQUIRED_ARGS: -transition=fixAliasThis | ||
|
|
||
| // https://issues.dlang.org/show_bug.cgi?id=16086 | ||
| struct A | ||
| { | ||
| void tail() {} | ||
| } | ||
|
|
||
| struct S16086 | ||
| { | ||
| struct Inner2 | ||
| { | ||
| Inner a; | ||
| alias a this; | ||
| } | ||
|
|
||
| struct Inner | ||
| { | ||
| int unique_identifier_name; | ||
| int tail = 2; | ||
| } | ||
|
|
||
| Inner2 inner; | ||
| alias inner this; | ||
|
|
||
| auto works() | ||
| { | ||
| return unique_identifier_name; | ||
| } | ||
|
|
||
| auto fails() | ||
| { | ||
| int a = tail; | ||
| return tail; // Line 22 | ||
| // The workaround: return this.tail; | ||
| } | ||
| } | ||
|
|
||
| // https://issues.dlang.org/show_bug.cgi?id=16082 | ||
| struct S16082 | ||
| { | ||
| struct Inner | ||
| { | ||
| int any_name_but_modulename; | ||
| int aliasthis = 5; | ||
| } | ||
|
|
||
| Inner inner; | ||
| alias inner this; | ||
|
|
||
| auto works() | ||
| { | ||
| return any_name_but_modulename; | ||
| } | ||
| auto fails() | ||
| { | ||
| return aliasthis; // Line 20 | ||
| } | ||
| } | ||
|
|
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