http://d.puremagic.com/issues/show_bug.cgi?id=9345
Summary: CTFE fails when using std.string.format with imported string enum Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: yazan.dab...@gmail.com --- Comment #0 from yazan.dab...@gmail.com 2013-01-18 03:43:42 PST --- File enumfile.d --------------- module enumfile; enum Foo : string { a = "Please print me", } File main.d ----------- import enumfile; import std.stdio; //without importing std.stdio or any other package, the CTFE error disappears import std.string; void main() { pragma(msg, "%s".format(Foo.a)); } Compiler output: format.d(7): Error: cannot cast a read-only string literal to mutable in CTFE format.d(7): called from here: format("%s", "Please print me") format("%s", "Please print me") The code compiles correctly when either the import for the unrelated package is commented out, or when the enum is moved to the same file. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------