associative array: unexpected results after static initialization

Steven Schveighoffer schveiguy at yahoo.com
Fri Dec 1 18:14:14 UTC 2017


On 12/1/17 12:02 PM, H. S. Teoh wrote:
> On Fri, Dec 01, 2017 at 11:59:08AM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote:
>> So I would say we should define that the last key/value combo takes
>> precedence, and it would be good to ensure that's the case with a
>> test.
> 
> Sure, but that means a spec update besides the unittest addition.

I'm not sure it even needs a spec "update", as there is no spec for it :)

But having the unit test at least ensures that someone implementing 
something different (though I don't ever see it happening) will notice 
the test.

As of now, someone can be depending on this behavior, and then such an 
implementation rewrite could get through and break their code.

I'll write a unit test, shouldn't be too hard.

-Steve


More information about the Digitalmars-d-learn mailing list