This is a D2 program: import std.stdio: writeln; void main() { writeln(typeid(string)); writeln(typeid(wstring)); writeln(typeid(dstring)); } I'd like the output of that program to be: string wstring dstring Instead of (dmd 2.047): immutable(char)[] immutable(wchar)[] immutable(dchar)[] "immutable(dchar)[]" is less readable, and dstring is a standard built-in alias in D2. Making them readable is especially important when string types are inside more complex types, to decrease the visual noise a lot. Example: import std.stdio; void main() { wstring[string[dstring]] a; writeln(typeid(typeof(a))); } Prints an unreadable: immutable(wchar)[][const(immutable(char)[])[immutable(dchar)[]]] While this is almost readable still: wstring[string[dstring]] See also bug 3086
I don't like special-casing, but I do agree the output would be more readable. Perhaps we need to introduce a new function that outputs a more readable string representation. Not sure..
Closing as WONTFIX. Rationale: Aliases are defined as being "transparent". This is currently in the spec, and what the compiler does. However people (including me) have come to expect aliases to be retained while being transparent. We added a bit of special-casing in the compiler to show 'string' when the type is 'immutable(char)[]'. It didn't resolve the core issue, but it did mitigate the problem. However, typeid relies on the generated typeinfo. Having alias generate their own typeinfo would bloat the binary to an impossible extent. Bear in mind that aliases are used everywhere in the compiler, so distinguishing between user-provided and compiler-generated aliases is a huge undertaking. For example, the names of template parameter are aliases. Putting aside the extremely negative impact it'd have on binary size, typeid is not that used in modern D code, so I doubt the feature is more than a nice to have nowadays.