Currently there is no way to get the name of the alias for a symbol type.
For example the following:
===
void main()
{
import std.traits;
size_t s;
pragma(msg, typeof(s).stringof);
pragma(msg, mangledName!(typeof(s)));
pragma(msg, mangledName!s);
}
===
Prints
---
ulong
m
_D9onlineapp4mainFZ1sm
---
For code generation porpoises (eg. generate C wrapper code) there is no way to get the type of `s` as `size_t` because `size_t` is an alias.
A new trait, `__traits(aliasName, symbol)`, could be used to retrieve the alias name for a symbol type.
This trait will return the name of the concrete type if the symbol type is not an alias.
Comment #1 by robert.schadek — 2024-12-13T18:59:20Z