AA bug..?

Vladimir Panteleev thecybershadow at gmail.com
Wed Sep 26 05:54:00 PDT 2007


On Wed, 26 Sep 2007 15:49:46 +0300, Simen Haugen <simen at norstat.no> wrote:

>  int[uint] aa1 = [4290904102:1, 1:2]; // This works because 42909... is
> first
>
>  int[uint] aa2 = [1:2, 4290904102:1]; // But here we get the error "cannot
> implicitly convert expression (4290904102L) of type long to int"
>
> Is there something I'm missing, or is this a bug?

An AA literal's types are determined by the first elements. You can use an explicit cast to set the literal's type:
int[uint] aa2 = [cast(uint)1:2, 4290904102:1]; 

-- 
Best regards,
 Vladimir                          mailto:thecybershadow at gmail.com



More information about the Digitalmars-d mailing list