[Issue 2732] New: Setting new key for Associative Array of Static Array causes RangeError

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 13 15:44:38 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2732

           Summary: Setting new key for Associative Array of Static Array
                    causes RangeError
           Product: D
           Version: 2.025
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, rejects-valid
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: hskwk at inter7.jp


string[2][string] hash;

// All assignment expressions listed below are compiled without any error nor
warning
// and throw runtime RangeError.
hash["key"] = ["a","b"]; 
hash["key"] = new string[2];
hash["key"] = null;
hash["key"] = "";
hash["key"] = [0,0]; 
hash["key"][0] = "";

assert(typeid(typeof(hash["key"])) == typeid(typeof(["a","b"])) );


On the other hand, Associative Array of Dynamic Array works well.

string[][string] hash;
hash["key"] = ["a", "b"];
writefln( hash["key"] ); 


occurs in both D1/D2.


-- 



More information about the Digitalmars-d-bugs mailing list