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
}
mixin(bug6457());
-----------------------------
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 number.
Comment #1 by hoganmeier — 2011-08-08T16:24:43Z
Isn't this even a regression?
Comment #2 by clugdbug — 2011-08-08T21:29:39Z
This doesn't work either, and it doesn't involve CTFE:
const char[] s = ['i','n','t',' ','a',';'];
mixin(s);
It's one of the few cases where arrays literals of chars aren't being accepted as string literals.