[Issue 6457] New: [CTFE] .idup or casting of char[] does not really create a string literal recognizable in 'mixin', which causes a line-less error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Aug 8 14:11:54 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6457
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
AssignedTo: nobody at puremagic.com
ReportedBy: kennytm at gmail.com
Blocks: 5373
--- Comment #0 from kennytm at gmail.com 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
}
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.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list