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 #1685 from AndrejMitrovic/Fix9574
Issue 9574 - Better diagnostic on old 'alias this = that' syntax.
- Loading branch information
Showing
2 changed files
with
31 additions
and
3 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,19 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/diag9574.d(12): Error: Cannot use syntax 'alias this = x', use 'alias x this' instead | ||
fail_compilation/diag9574.d(18): Error: Cannot use syntax 'alias this = x', use 'alias x this' instead | ||
--- | ||
*/ | ||
|
||
struct S | ||
{ | ||
int x; | ||
alias this = x; | ||
} | ||
|
||
class C | ||
{ | ||
int x; | ||
alias this = x; | ||
} |