Commit graph

2 commits

Author SHA1 Message Date
Paul Backus
946079235d Allow alias this to use assignment-style syntax
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] https://github.com/dlang/dmd/pull/1187
[2] https://dlang.org/changelog/2.061.html
[3] https://github.com/dlang/dmd/pull/1413
[4] https://dlang.org/changelog/2.062.html
[5] https://github.com/dlang/dlang.org/pull/200#issuecomment-11711854
2023-05-10 11:43:19 +02:00
Iain Buclaw
6374bb87b7 Move dmd files into compiler/ 2022-07-09 18:53:07 +02:00
Renamed from test/compilable/aliasdecl.d (Browse further)