[Issue 2292] New: .reash of associative arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 19 08:14:53 PDT 2008


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

           Summary: .reash of associative arrays
           Product: D
           Version: 1.034
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: enzo.petrelli at fastwebnet.it


/***************************
        OS:                     Windows XP Pro SP2 / Vista SP1
        Compiler/linker:        Digital Mars D Compiler v1.034
        Tango/tangobos Lib:     tango-0.99.7-bin-win32-dmd.1.033
        Compiled with:          no compile/link flag

        after a call to .rehash of an associative array, accessing the .keys of
        the associative array gives 'Access violation'

 ***************************/

import std.cstream;

void main()
{
        int[char[]] aiHash;
        aiHash["one"] = 1;
        aiHash["two"] = 2;
        aiHash["three"] = 3;
        aiHash["four"] = 4;
        aiHash["five"] = 5;
// uncommenting the following line, execution gives "Access violation"
//      aiHash.rehash;
        foreach (char[] sKey; aiHash.keys)
                dout.writefln("%-8s ==> %d", sKey, aiHash[sKey]);
}


-- 



More information about the Digitalmars-d-bugs mailing list