Bug 7270 – Eliminate needless qualifiers in `TypeInfo.toString`

Status
NEW
Severity
enhancement
Priority
P4
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-11T05:24:38Z
Last change time
2024-12-07T13:31:48Z
Assigned to
No Owner
Creator
bearophile_hugs
See also
http://d.puremagic.com/issues/show_bug.cgi?id=4741
Moved to GitHub: dmd#17240 →

Comments

Comment #0 by bearophile_hugs — 2012-01-11T05:24:38Z
import std.stdio; void main() { alias const(const(int)[]) T; writeln(typeid(T)); writeln(T.stringof); pragma(msg, T.stringof); } Output, DMD 2.058head: const(int[]) const(const(int)[]) const(int[]) Expected output: const(int[]) const(int[]) const(int[])
Comment #1 by k.hara.pg — 2012-01-11T06:42:09Z
This is TypeInfo.toString problem. import std.stdio; void main() { alias const(const(int)[]) T; pragma(msg, "1: ", T.stringof); writeln("2: ", typeid(T)); writeln("3: ", T.stringof); } Output: ---- 1: const(int[]) // pragma + T.stringof 2: const(const(int)[]) // writeln + typeid(T) (== TypeInfo.toString()) 3: const(int[]) // writeln + T.stringof Changed the title.
Comment #2 by k.hara.pg — 2012-01-11T06:43:05Z
And, this is druntime issue, not dmd's.
Comment #3 by andrej.mitrovich — 2013-09-26T07:16:34Z
*** Issue 4741 has been marked as a duplicate of this issue. ***
Comment #4 by andrej.mitrovich — 2013-09-26T07:17:05Z
(In reply to comment #3) > *** Issue 4741 has been marked as a duplicate of this issue. *** See my comment in 4741 for more examples: http://d.puremagic.com/issues/show_bug.cgi?id=4741#c0
Comment #5 by verylonglogin.reg — 2013-11-07T08:25:21Z
`const(const(int)[])` is the same as `const(int[])`. The latter notation is just shorter. So this in an enhancement request to shorten type names by eliminating needless qualifiers in `TypeInfo.toString`.
Comment #6 by verylonglogin.reg — 2013-11-07T08:26:44Z
(In reply to comment #4) > (In reply to comment #3) > > *** Issue 4741 has been marked as a duplicate of this issue. *** > > See my comment in 4741 for more examples: > http://d.puremagic.com/issues/show_bug.cgi?id=4741#c0 Issue 4741 has no connection with this one.
Comment #7 by greeenify — 2019-04-09T05:43:15Z
A tentative fix can be found on GitHub: https://github.com/dlang/druntime/pull/2374
Comment #8 by robert.schadek — 2024-12-07T13:31:48Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17240 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB