Problem with multi-dimensional associative arrays?

Carlos Santander csantander619 at gmail.com
Thu Apr 26 15:25:11 PDT 2007


Brian Palmer escribió:
> This code works with DMD 1.010 for Windows, but fails with an ArrayBoundsError on gdc 0.23, using dmd 1.007
> 
> void main() {
>   int stuff[char[]][char[]];
>   stuff["brian"]["pocket"] = 3;
> }
> 
> It appears that GDC doesn't know how to handle multi-dimensional AAs.
> 
> (My environment: i686-apple-darwin8-gdc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5363) (gdc 0.23, using dmd 1.007), I'm using a pre-compiled binary of GDC downloaded from http://sourceforge.net/projects/gdcmac)

Try inserting this between those two lines:

stuff["brian"] = null;

I haven't tested it, but that's how I've always got stuff like that to work.

-- 
Carlos Santander Bernal


More information about the D.gnu mailing list