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: bugzi...@digitalmars.com
        ReportedBy: hs...@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.


-- 

Reply via email to