digitalmars.D.bugs - [Issue 1322] New: foreach bypasses invariant
- d-bugmail puremagic.com (23/23) Jul 08 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1322
- d-bugmail puremagic.com (5/5) Jul 08 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1322
- d-bugmail puremagic.com (9/9) Sep 02 2008 http://d.puremagic.com/issues/show_bug.cgi?id=1322
http://d.puremagic.com/issues/show_bug.cgi?id=1322 Summary: foreach bypasses invariant Product: D Version: 2.002 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: Daniel919 web.de import std.stdio; void main() { invariant(char)[] s = "test"; foreach (ref char c; s) { c = 'a'; break; } writefln(s); } The output is 'aest' which means that the invariant char array got changed. --
Jul 08 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1322 Additional thoughts about it: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=55316 --
Jul 08 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1322 bugzilla digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Fixed dmd 2.019 --
Sep 02 2008