Associative array with duplicated keys?

Marc Schütz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Nov 5 02:22:59 PST 2015


On Thursday, 5 November 2015 at 08:55:10 UTC, Andrea Fontana 
wrote:
> Check this:
> http://dpaste.dzfl.pl/ebbb3ebac60e
>
> It doesn't give any error or warning. And writeln seems 
> confused (do you see that "," at the end?)

This is an outright bug, please report on issues.dlang.org:

void main()
{
     import std.stdio : writeln;
     ["key": 10, "key" : 20, "key" : 30].length.writeln;
     ["key" : 30].length.writeln;
}

Prints:
3
1



More information about the Digitalmars-d-learn mailing list