Summary: [CTFE] .idup or casting of char[] does not really
                    create a string literal recognizable in 'mixin', which
                    causes a line-less error
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: diagnostic, rejects-valid
          Severity: critical
          Priority: P2
         Component: DMD
            Blocks: 5373

--- Comment #0 from 2011-08-08 14:11:52 PDT ---
Test case:

string bug6457() {
    auto d = new char[6];
    d[] = "int a;";
    return d.idup;           // <-- won't make a real string
    // return cast(string)d; // <-- neither does this
Error: argument to mixin must be a string, not (['i','n','t',' ','a',';'])

This affects all codes that uses std.array.appender. 'mixin' should be able to
accept a string casted/idup-ed from a 'char[]', or the interpreter should be
able to convert a 'char[]' expression to a StringExp in a 'cast(string)', and
no matter which solution is taken, the error of 'mixin' should have the line

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to