[Issue 2265] New: AA initializer with string as key is bugged

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 3 09:21:43 PDT 2008


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 at digitalmars.com
        ReportedBy: lutger.blijdestijn at 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


-- 



More information about the Digitalmars-d-bugs mailing list