http://d.puremagic.com/issues/show_bug.cgi?id=7922

           Summary: alias this causes weird formatting issues for strings
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2012-04-16 
06:26:12 PDT ---
import std.string;
import std.stdio;

struct Wrap
{
    string _payload;
    alias _payload this;
}

void main()
{
    Wrap foo;
    string x = format("%s %s", "1", "2");
    foo ~= x;
    writeln(foo);  // writes: 1 2

    Wrap bar;
    bar ~= format("%s %s", "1", "2");
    writeln(bar);  // writes:
(immutable(char)[],immutable(char)[],immutable(char)[])1 2
}

What's going on here?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to