dmd v.163 foreach question: int[] is not an array of int[]

clayasaurus clayasaurus at gmail.com
Wed Jul 19 23:01:41 PDT 2006


My question is this, with the current code, why is the first statement 
valid but as soon as you try to iterate with foreach the code becomes 
invalid? I get the error "int[] is not an array of int[]". Bug? 
Misunderstanding? Thanks.

~ Clay

int[][char[]] bob;

int main()
{
     // this code is valid
     int[] b1 = bob["world"];


     foreach(char[] k; bob.keys)
         // int[] is not an array of int[]
         foreach(int[] b; bob[k])
         {
         }

     return 0;
}



More information about the Digitalmars-d-learn mailing list