http://d.puremagic.com/issues/show_bug.cgi?id=6815
Summary: Char array is turned into string expression during constant folding Product: D Version: D2 Platform: Other OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: d...@dawgfoto.de --- Comment #0 from d...@dawgfoto.de 2011-10-15 20:35:22 PDT --- struct DChars { dchar foo() { return ary[0]; } dchar[] ary; } DChars get() { DChars s; s.ary ~= 'H'; s.ary ~= 'e'; return s; } enum dchars = get().foo(); ---- Which will bark: Error: cannot cast a read-only string literal to mutable in CTFE Cat in constfold.c turns null ~ char into a string expression even though the type of null is not a string but a char array. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------