Comment #1 by bearophile_hugs — 2012-10-21T13:47:18Z
It doesn't work still, see:
void main() {
int[int] aa1 = [1: 2];
int[int] aa2 = [1: 2];
int[int[int]] aa3;
aa3[aa1] = 1;
aa3[aa2] = 2;
assert(aa3.length == 1);
}
In DMD 2.061alpha the aa3 has two identical keys.
Comment #2 by andrej.mitrovich — 2012-10-21T13:54:26Z
(In reply to comment #1)
> It doesn't work still, see:
>
> void main() {
> int[int] aa1 = [1: 2];
> int[int] aa2 = [1: 2];
> int[int[int]] aa3;
> aa3[aa1] = 1;
> aa3[aa2] = 2;
> assert(aa3.length == 1);
> }
>
>
> In DMD 2.061alpha the aa3 has two identical keys.
Have you tried HEAD? I see two keys:
assert(aa3.length == 2); // passes for me
Comment #3 by andrej.mitrovich — 2012-10-21T13:57:54Z
(In reply to comment #2)
> (In reply to comment #1)
> > It doesn't work still, see:
> >
> > void main() {
> > int[int] aa1 = [1: 2];
> > int[int] aa2 = [1: 2];
> > int[int[int]] aa3;
> > aa3[aa1] = 1;
> > aa3[aa2] = 2;
> > assert(aa3.length == 1);
> > }
> >
> >
> > In DMD 2.061alpha the aa3 has two identical keys.
>
> Have you tried HEAD? I see two keys:
> assert(aa3.length == 2); // passes for me
On second thought I'm not sure what you're asking. You want the two keys to be just one key?
Comment #4 by bearophile_hugs — 2012-10-21T14:15:58Z
(In reply to comment #3)
> On second thought I'm not sure what you're asking. You want the two keys to be
> just one key?
Yeah, sorry for not being clear enough. aa1 == aa2 so at the end aa3 should contain only one key with value 2.
Comment #5 by clugdbug — 2013-01-28T00:40:02Z
(In reply to comment #1)
> It doesn't work still, see:
>
> void main() {
> int[int] aa1 = [1: 2];
> int[int] aa2 = [1: 2];
> int[int[int]] aa3;
> aa3[aa1] = 1;
> aa3[aa2] = 2;
> assert(aa3.length == 1);
> }
>
>
> In DMD 2.061alpha the aa3 has two identical keys.
This code passes now on git head (f8ddb72).
Comment #6 by bearophile_hugs — 2013-01-28T03:01:26Z