[Issue 4527] writeln/typeid to not expand aliases (for string types)

2018-05-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4527

Dmitry Olshansky  changed:

   What|Removed |Added

 CC||dmitry.o...@gmail.com
Summary|writeln/typeid to use   |writeln/typeid to not
   |string type names   |expand aliases (for string
   ||types)

--


[Issue 4527] writeln/typeid to not expand aliases (for string types)

2020-01-16 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4527

Mathias LANG  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||pro.mathias.l...@gmail.com
 Resolution|--- |WONTFIX

--- Comment #2 from Mathias LANG  ---
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.

--