Commit 9460792
Allow
When assignment-style syntax for alias declarations was first
implemented in DMD 2.061 [1][2], `alias this = identifier;` was accepted
as equivalent to the existing `alias identifier this;`. One release
later, in DMD 2.062, it was removed. [3]
The rationale for this change, given in both the changelog [4] and a
related spec PR thread [5], was to allow for the possibility that, in
the future, the syntax `alias this = super.this;` might be used to merge
a derived class's constructor overload set with that of its base class.
However, this proposal was never implemented, and seems to have been
abandoned in the intervening years.
For the sake of consistency, and since the rationale for its removal no
longer applies, this commit reinstates `alias this = identifier;` as
valid syntax for an `alias this` declaration.
[1] #1187
[2] https://dlang.org/changelog/2.061.html
[3] #1413
[4] https://dlang.org/changelog/2.062.html
[5] dlang/dlang.org#200 (comment)alias this to use assignment-style syntax1 parent 6d36ef8 commit 9460792
File tree
3 files changed
+17
-42
lines changed- compiler
- src/dmd
- test
- compilable
- fail_compilation
3 files changed
+17
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4515 | 4515 | | |
4516 | 4516 | | |
4517 | 4517 | | |
4518 | | - | |
4519 | | - | |
4520 | | - | |
4521 | | - | |
| 4518 | + | |
4522 | 4519 | | |
4523 | 4520 | | |
4524 | 4521 | | |
| |||
4780 | 4777 | | |
4781 | 4778 | | |
4782 | 4779 | | |
4783 | | - | |
| 4780 | + | |
| 4781 | + | |
| 4782 | + | |
| 4783 | + | |
4784 | 4784 | | |
4785 | | - | |
4786 | | - | |
4787 | | - | |
4788 | | - | |
4789 | | - | |
4790 | | - | |
4791 | | - | |
4792 | | - | |
4793 | | - | |
4794 | | - | |
4795 | | - | |
4796 | | - | |
4797 | | - | |
4798 | | - | |
4799 | | - | |
| 4785 | + | |
| 4786 | + | |
| 4787 | + | |
| 4788 | + | |
| 4789 | + | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + | |
| 4793 | + | |
4800 | 4794 | | |
4801 | 4795 | | |
4802 | 4796 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
This file was deleted.
0 commit comments