[2024 edition] Disallow alias ... ident; syntax#22244
[2024 edition] Disallow alias ... ident; syntax#22244thewilsonator merged 1 commit intodlang:masterfrom
alias ... ident; syntax#22244Conversation
|
Thanks for your pull request and interest in making D better, @ntrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#22244" |
|
BTW the |
|
I'm a fan of the new syntax, but I did recently notice in core/sys/windows/basetsd.d that the new syntax doesn't allow multiple aliases in one go like this: alias ulong ULONG64, DWORD64, UINT64;
alias ulong* PULONG64, PDWORD64, PUINT64;I have no problem splitting those up, but it might be worth considering |
Do you mean have something like: alias ULONG64 = DWORD64 = UINT64 = ulong;
// vs repeating now:
alias ULONG64 = ulong, DWORD64 = ulong, UINT64 = ulong;It doesn't seem to be a common case, the 2nd one seems OK IMO. |
|
This should maybe be held off until druntime and phobos pass with |
|
Dependant PR merged, is this good to go now? |
Nevermind, I didn't realize the new syntax supported a comma. I was imagining having to split them up like this: alias PULONG64 = ulong*;
alias PDWORD64 = ulong*;
alias PUINT64 = ulong*; |
|
@thewilsonator druntime (not sure about Phobos) has a lot of old alias declaration syntax, it might be best for those to be updated before merging this, otherwise it leaves the work for whoever adds support to the test suite to test druntime with the edition flag. |
See dlang#22244. I used `dfix` with some updates: dlang-community/dfix#63 I did: * revert a few unrelated diff hunks it produced (`core/sys/linux/ input.d`) * manually update a mixin in `core/sys/linux/link.d` * put a stripped out comment back in `core/sys/windows/basetyps.d`: `alias UUID = GUID, /*IID, CLSID, */FMTID = GUID, uuid_t = GUID;`
See dlang#22244. I used `dfix` with some updates: dlang-community/dfix#63 I did: * revert a few unrelated diff hunks it produced (`core/sys/linux/ input.d`) * manually update a mixin in `core/sys/linux/link.d` * put a stripped out comment back in `core/sys/windows/basetyps.d`: `alias UUID = GUID, /*IID, CLSID, */FMTID = GUID, uuid_t = GUID;` There's at least 2 long aliases with multiple components that could be broken up: * at the start of `core/sys/windows/commdlg.d` * in `core/sys/windows/wincrypt.d`
See dlang#22244. I used `dfix` with some updates: dlang-community/dfix#63 I did: * revert a few unrelated diff hunks it produced (`core/sys/linux/ input.d`) * manually update a mixin in `core/sys/linux/link.d` * put a stripped out comment back in `core/sys/windows/basetyps.d`: `alias UUID = GUID, /*IID, CLSID, */FMTID = GUID, uuid_t = GUID;` There's at least 2 long aliases with multiple components that could be broken up: * at the start of `core/sys/windows/commdlg.d` * in `core/sys/windows/wincrypt.d`
See #22244. I used `dfix` with some updates: dlang-community/dfix#63 I did: * revert a few unrelated diff hunks it produced (`core/sys/linux/ input.d`) * manually update a mixin in `core/sys/linux/link.d` * put a stripped out comment back in `core/sys/windows/basetyps.d`: `alias UUID = GUID, /*IID, CLSID, */FMTID = GUID, uuid_t = GUID;` There's at least 2 long aliases with multiple components that could be broken up: * at the start of `core/sys/windows/commdlg.d` * in `core/sys/windows/wincrypt.d`
See dlang/dmd#22244. I used `dfix` with some updates: dlang-community/dfix#63 I did: * revert a few unrelated diff hunks it produced (`core/sys/linux/ input.d`) * manually update a mixin in `core/sys/linux/link.d` * put a stripped out comment back in `core/sys/windows/basetyps.d`: `alias UUID = GUID, /*IID, CLSID, */FMTID = GUID, uuid_t = GUID;` There's at least 2 long aliases with multiple components that could be broken up: * at the start of `core/sys/windows/commdlg.d` * in `core/sys/windows/wincrypt.d`
See dlang/dmd#22244. I used `dfix` with some updates: dlang-community/dfix#63 I did: * revert a few unrelated diff hunks it produced (`core/sys/linux/ input.d`) * manually update a mixin in `core/sys/linux/link.d` * put a stripped out comment back in `core/sys/windows/basetyps.d`: `alias UUID = GUID, /*IID, CLSID, */FMTID = GUID, uuid_t = GUID;` There's at least 2 long aliases with multiple components that could be broken up: * at the start of `core/sys/windows/commdlg.d` * in `core/sys/windows/wincrypt.d`
I used [dscanner](dlang-community/D-Scanner#975). Needed as dlang/dmd#22244 was merged.
I used [dscanner](dlang-community/D-Scanner#975). Needed as dlang/dmd#22244 was merged.
I used [dscanner](dlang-community/D-Scanner#975). Needed as dlang/dmd#22244 was merged.
Use
alias ident = ...;form instead.Add a parser error, similar to the
bodykeyword edition error (see test).Note: The
alias this = ...;syntax was added in 2023. Should the oldalias ... this;syntax also be an edition error, or will that break too much code?