AA keys

Jarrett Billingsley kb3ctd2 at yahoo.com
Sun Mar 16 16:58:26 PDT 2008


"bearophile" <bearophileHUGS at lycos.com> wrote in message 
news:frjrkc$18k9$1 at digitalmars.com...
> Can you explain this to me?
> Is this yet another corner case (or bug?)?
>
> import std.stdio: writefln;
>
> void main() {
>    int[int] aa1 = [1:2, 3:4];
>    int[int] aa2 = [5:6, 7:8];
>    byte[int[int]] s;
>    writefln(aa1, " ", aa2); // Prints: [1:2,3:4] [5:6,7:8]
>
>    s[aa1] = 1;
>    s[aa2] = 2;
>    writefln(s); // Prints: [[1:2,3:4]:2]
> }
>
> Bye,
> bearophile

And to confirm it, s.length is 1, not 2.  There were originally some bugs in 
std.format's array and AA handling, but this is definitely not an output 
bug.

I'd bugzilla it if I were you. 




More information about the Digitalmars-d-learn mailing list