digitalmars.D.bugs - [Issue 2376] New: CTFE fails on array literal of array literals of chars
- d-bugmail puremagic.com (23/23) Sep 27 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2376
- d-bugmail puremagic.com (17/17) Sep 27 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2376
- d-bugmail puremagic.com (4/4) Sep 27 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2376
- d-bugmail puremagic.com (4/4) Oct 03 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2376
- d-bugmail puremagic.com (4/4) Oct 04 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2376
- d-bugmail puremagic.com (9/9) Oct 20 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2376
http://d.puremagic.com/issues/show_bug.cgi?id=2376 Summary: CTFE fails on array literal of array literals of chars Product: D Version: 2.019 Platform: PC OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: samukha voliacable.com string foo(string[] ss) { string r; r ~= ss[0]; // problem here return r; } enum r = foo([['c'], ['d']]); ---- cannot evaluate foo([['c'],['d']]) at compile time --
Sep 27 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2376 This applies to any array of arrays, not only chars. To workaround, initialize r in foo to []: string foo(string[] ss) { string r = []; // Interestingly, "" doesn't work. r ~= ss[0]; return r; } enum r = foo([['c'], ['d']]); However, the result of foo is crippled in a way that it cannot be processed further at compile time. For example, pragma(msg, r) fails with Error: string expected for message, not '['c']' The bug is also present in dmd 1. --
Sep 27 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2376 ------- This one's probably related to, if not a duplicate of, Issue 1059. --
Sep 27 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2376 Please file pragma(msg, ['c']) as a separate report. --
Oct 03 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2376 done. http://d.puremagic.com/issues/show_bug.cgi?id=2391 --
Oct 04 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2376 bugzilla digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Fixed dmd 1.036 and 2.020 --
Oct 20 2008