http://d.puremagic.com/issues/show_bug.cgi?id=6504
Summary: Regression(2.041): "str" ~ [arr] allows string literal to be modified Product: D Version: D1 & D2 Platform: Other OS/Version: Windows Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: clugd...@yahoo.com.au --- Comment #0 from Don <clugd...@yahoo.com.au> 2011-08-16 03:08:19 PDT --- for (int i=0; i<3; ++i) { char[] x2 = "xxx" ~ ['c']; assert(x2[1] == 'x'); x2[1] = 'q'; } The assertion fails the second time through the loop. What happens, is that "xxx" ~ ['c'] becomes a string literal of value "xxxc" and type char[]. Thus, it is modifiable. This code passes on 2.040. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------