digitalmars.D.bugs - [Issue 2265] New: AA initializer with string as key is bugged
- d-bugmail puremagic.com (28/28) Aug 03 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2265
- d-bugmail puremagic.com (12/12) Aug 13 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2265
- d-bugmail puremagic.com (9/9) Nov 18 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2265
http://d.puremagic.com/issues/show_bug.cgi?id=2265 Summary: AA initializer with string as key is bugged Product: D Version: 2.000 Platform: PC OS/Version: Linux Status: NEW Keywords: wrong-code Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: lutger.blijdestijn gmail.com Initializing an associative array with strings as key doesn't work correctly in D2, see the following program: import std.stdio; void main() { string[string] aa = [ "foo" : "bar"]; aa["foo"] = "baz"; foreach (key, value; aa) writefln(key, " - ", value); } Ouput is: foo - bar foo - baz This happens only with strings as the key type and only in D2 --
Aug 03 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2265 lutger.blijdestijn gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lutger.blijdestijn gmail.com Keywords|wrong-code |accepts-invalid, diagnostic I'm sorry, this bug report was wrong. According to the spec, aa literals cannot be used to statically initialize anything. Now the issue is still that dmd should report this as an error. This also holds for D1 where no error is reported. --
Aug 13 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2265 gide nwawudu.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE *** This bug has been marked as a duplicate of 2333 *** --
Nov 18 2008