Bug 17266 – pragma msg not condensing wstrings

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-03-18T14:24:59Z
Last change time
2024-12-13T18:51:50Z
Assigned to
No Owner
Creator
TeddyBear12311
Moved to GitHub: dmd#19240 →

Comments

Comment #0 by TeddyBear12311 — 2017-03-18T14:24:59Z
when printing out a manifest constant using pragma(msg, c) the output is ugly: [Tuple(['w', 'c', 'h', 'a', 'r'])] The following exhibits the issue: import std.typecons, std.string, std.conv; enum x = [tuple(to!wstring(strip(" wchar")))]; pragma(msg, x); enum y = [tuple(to!wstring(strip(" wchar"))~"")]; pragma(msg, y); enum z = [tuple(to!wstring(strip(" wchar"))~""w)]; pragma(msg, z); void main() { } [Tuple(['w', 'c', 'h', 'a', 'r'])] [Tuple("wchar")] [Tuple("wchar")] Maybe pragma should treat array's of wchars/chars, etc as a string. Or check if all the values are "printable" and then print it was a string.
Comment #1 by TeddyBear12311 — 2017-03-18T14:33:14Z
It might be nice also to have a reduced syntax for Tuple!(having tuples of tuples of tuples becomes quite messy and makes the strings/output very long). instead of [Tuple("wchar")] we get [{"wchar"}] where {} are used to represent a tuple. If {} is not good enough(conflicts with something else), then <>, T{}, T(), or something similar can be used.
Comment #2 by robert.schadek — 2024-12-13T18:51:50Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19240 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB