Array of BitArrays definition compiles in DMD but not in GDC.

TheGag96 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 8 14:40:00 PDT 2015


In my code I'm passing an array of BitArrays to a constructor 
like this (though mostly as a placeholder):

   Terrain t = new Terrain(1, 15, [
     BitArray([1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]),
     BitArray([1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1]),
     BitArray([0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1]),
     BitArray([0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1]),
     BitArray([0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1]),
     BitArray([1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1]),
   ]);

The code compiles fine when using DMD 2.068.1 but GDC 5.2.1, I 
get this error for every line:

error: cannot implicityly convert expression ([stuff]) of type 
int[] to ulong

Why does this compiler difference exist and how do I get around 
it? Thanks!


More information about the Digitalmars-d-learn mailing list