associative array: unexpected results after static initialization

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Dec 1 16:23:33 UTC 2017


On Fri, Dec 01, 2017 at 04:06:50PM +0000, kdevel via Digitalmars-d-learn wrote:
> On Friday, 1 December 2017 at 00:42:00 UTC, H. S. Teoh wrote:
> > Here's the fix:
> > 
> > 	https://github.com/dlang/druntime/pull/1980
> 
> And wouldn't it be reasonable to add
> 
>    assert(aa.values == [ "b" ]);
> 
> to the unittest?

I did think about adding that, but then I didn't want the unittest to
dictate which value should take precedence when there are duplicate
keys, since that is currently implementation-dependent.  At the very
least, it merits further discussion.


T

-- 
Never trust an operating system you don't have source for! -- Martin Schulze


More information about the Digitalmars-d-learn mailing list