[Issue 17266] New: pragma msg not condensing wstrings

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Mar 18 07:24:59 PDT 2017


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

          Issue ID: 17266
           Summary: pragma msg not condensing wstrings
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: TeddyBear12311 at gmail.com

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.

--


More information about the Digitalmars-d-bugs mailing list