Skip to content

[druntime] Replace old AliasDeclaration syntax for 2024 edition#22490

Merged
thewilsonator merged 1 commit intodlang:masterfrom
ntrel:druntime-alias
Feb 1, 2026
Merged

[druntime] Replace old AliasDeclaration syntax for 2024 edition#22490
thewilsonator merged 1 commit intodlang:masterfrom
ntrel:druntime-alias

Conversation

@ntrel
Copy link
Contributor

@ntrel ntrel commented Feb 1, 2026

See #22244. Needed for #22275. @thewilsonator.

I used dfix master (recently updated dlang-community/dfix#63).

I did:

  • revert a few unrelated diff hunks it produced (trailing struct semi-colons core/sys/linux/input.d)
  • manually update an alias in a mixin: 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

E.g.:

-alias UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow
-    LPCCHOOKPROC, LPCFHOOKPROC, LPFRHOOKPROC, LPOFNHOOKPROC,
-    LPPAGEPAINTHOOK, LPPAGESETUPHOOK, LPSETUPHOOKPROC, LPPRINTHOOKPROC;
+alias LPCCHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow, LPCFHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow, LPFRHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow, LPOFNHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow, LPPAGEPAINTHOOK = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow, LPPAGESETUPHOOK = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow, LPSETUPHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow, LPPRINTHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow;

It might be better to put each ident = on a new line:

+alias LPCCHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow,
	LPCFHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow,
	LPFRHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow,
	LPOFNHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow,
	LPPAGEPAINTHOOK = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow,
	LPPAGESETUPHOOK = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow,
	LPSETUPHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow,
	LPPRINTHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow;

or reuse the first ident as the target of the other idents:

alias LPCCHOOKPROC = UINT_PTR function (HWND, UINT, WPARAM, LPARAM) nothrow, LPCFHOOKPROC = LPCCHOOKPROC, LPFRHOOKPROC = LPCCHOOKPROC, LPOFNHOOKPROC = LPCCHOOKPROC, LPPAGEPAINTHOOK = LPCCHOOKPROC, LPPAGESETUPHOOK = LPCCHOOKPROC, LPSETUPHOOKPROC = LPCCHOOKPROC, LPPRINTHOOKPROC = LPCCHOOKPROC;

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`
@dlang-bot
Copy link
Contributor

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 verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

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 references

Your 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 locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#22490"

@thewilsonator thewilsonator merged commit 90772c4 into dlang:master Feb 1, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants