[Issue 13995] Alias type stringof decay to alias type stringof

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jan 17 22:57:21 PST 2015


https://issues.dlang.org/show_bug.cgi?id=13995

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m

--- Comment #4 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
While I can certainly see why you'd want this (and it may very well be that we
should make the change), I would point out that aliases _always_ disappear when
they're used. I'm not aware of anywhere that the compiler treats the alias as
anything other than the original to the point that it just about might as well
be searching and replacing the alias with the original symbol in the text of
the program. The alias never shows up in any error messages. So, having it show
up with stringof would be a pretty major change with regards to how aliases are
treated (be that for better or for worse).

As for this specific problem, I would point out that your initial example
doesn't use aliases at all, so it doesn't show how the current behavior of
stringof on an alias would actually cause compilation problems, and your follow
up examples just show how stringof on an alias prints the original symbol
rather than the alias name. They don't show how that actually causes problems.

So, as a follow up to what Walter requested, I'd ask that you provide an
example that would compile if stringof on an alias gave the alias name rather
than the original symbol name and which does not compile with the current
behavior. So, it shows what you're actually trying to do but isn't working
right now. As it stands, I don't understand what you're trying to do well
enough to unnderstand why the current behavior is causing a problem, and I
suspect that Walter is in the same boat.

--


More information about the Digitalmars-d-bugs mailing list