An incorrect associative array work?

Dark Hole dark.hole1 at
Sat Sep 19 19:38:29 UTC 2020

Let's take a look at this code:

int[char[]] test;
char[4] buf = "abcd";
test[buf] = 1;
buf = "evil";

What we're expecting to see:
But real result is:

But if we replace static array with dynamic, we'll get error "key 
must be immutable". Not exactly what we expected, but ok. If we 
declare test as int[char[4]], it works as expected.

So, is this behaviour bug?

More information about the Digitalmars-d mailing list